Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- #include <unordered_set>
- #include <limits>
- #include <cmath>
- #include <iomanip>
- #include <algorithm>
- #include <cassert>
- using namespace std;
- double dist(double x1, double y1, double x2, double y2){
- return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
- }
- int32_t main() {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- double x1,y1;
- double x2,y2;
- double x3,y3;
- cin>>x1>>y1>>x2>>y2>>x3>>y3;
- double a = dist(x1,y1, x2, y2);
- double b = dist(x1,y1, x3, y3);
- double c = dist(x2,y2, x3, y3);
- double p = a+b+c;
- int ans = 1e-3 + sqrt(p*(p-a*2)*(p-b*2)*(p-c*2));
- cout<<ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement