Mai intai trebuie sa te autentifici.
Cod sursa(job #1237232)
| Utilizator | Data | 3 octombrie 2014 13:24:52 | |
|---|---|---|---|
| Problema | Aria | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.51 kb |
#include<bits/stdc++.h>
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
const int NMAX=100005;
int n;
long double a[NMAX],b[NMAX];
long double sol;
int main()
{
int i;
long double aux,baux;
fin>>n;
for (i=1;i<=n;i++) fin>>a[i]>>b[i];
for (i=1;i<n;i++)
sol=sol+(1LL*a[i]*b[i+1]-1LL*a[i+1]*b[i])/2;
sol=sol+(1LL*a[n]*b[1]-1LL*a[1]*b[n])/2;
cout<<setprecision(5)<<fixed;
if (sol<0) sol=abs(sol);
fout<<sol<<"\n";
return 0;
}
