Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2), problem: (D) Volatile Kite Solution In C/C++

By |2017-07-24T01:29:06+00:00July 24th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , , |

#include<cstdio> #include<cstdlib> #include<cmath> #include<algorithm> #include<cstring> using namespace std; #define maxn 1005 int x[maxn],y[maxn]; int n; long long area(int i) { int j=(i-1+n)%n,k=(i+1)%n; long long x1=x[i]-x[j],y1=y[i]-y[j], x2=x[i]-x[k],y2=y[i]-y[k]; return abs(x1*y2-x2*y1); } double length(int i) { int j=(i-1+n)%n,k=(i+1)%n; long long dx=x[j]-x[k],dy=y[j]-y[k]; return sqrt(dx*dx+dy*dy); } int main() { [...]