Cod sursa(job #3287237)
| Utilizator | Data | 17 martie 2025 08:55:18 | |
|---|---|---|---|
| Problema | Aria | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.53 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
struct Punct {
double x, y;
} p[100002];
double rasp;
int n, i;
int main() {
ios_base::sync_with_stdio(false);
fin.tie(nullptr);
fout.tie(nullptr);
fin >> n;
for(i = 1; i <= n; i++) fin >> p[i].x >> p[i].y;
p[n + 1] = p[1];
for(i = 1; i <= n; i++) rasp += (p[i].x * p[i + 1].y - p[i + 1].x * p[i].y);
fout << setprecision(5) << fixed << (double)abs(rasp) / 2.0;
return 0;
}
