Cod sursa(job #2309470)
| Utilizator | Data | 29 decembrie 2018 00:50:58 | |
|---|---|---|---|
| Problema | Aria | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.52 kb |
#include <bits/stdc++.h>
#define x first
#define y second
/// TONI BO$$ was here
/// #MLC
using namespace std;
pair <long double,long double> v[100001];
int main()
{
int n,i,j;
ios::sync_with_stdio(false);
ifstream in("aria.in");
ofstream out("aria.out");
in>>n;
long double s=0;
for(i=0; i<n; i++)
in>>v[i].x>>v[i].y;
for(i=0; i<n; i++)
{
j=(i+1)%n;
s+=(v[i].x*v[j].y-v[i].y*v[j].x);
}
out<<fixed<<setprecision(8)<<s/2.0;
return 0;
}
