Cod sursa(job #2719219)

Utilizator KPP17Popescu Paul KPP17 Data 9 martie 2021 18:18:54
Problema Aria Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.42 kb
#include <fstream>
#define mF "aria"
std::ifstream in(mF ".in");
std::ofstream out(mF ".out");
const int N = 100000;
#include <iomanip>
#include <tuple>
#include <cmath>
int main()
{
    int n; double a, b, c, d, e, f, s = .0; in >> n >> a >> b;
    for (e = a, f = b; c = e, d = f, in >> e >> f, --n;) s += c * f - e * d;
    out << std::setprecision(7) << std::fixed << std::abs(s + c * b - a * d) / 2;
}