admin 发表于 2024-5-7 15:58:38

P10410 「QFOI R2」寺秋山霭苍苍



https://www.luogu.com.cn/problem/P10410?contestId=166040
#include <bits/stdc++.h>
using namespace std;

inline double cal(double mj, double p) {
    return S - 3.0 * (mj * p * (1.0 - p));
}

int main() {
      double l, r, x1, y1, x2, y2, x3, y3,a,b,c,p,s,k = 0.5;
    cin >> l >> r >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
   a = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
   b = sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3));
   c = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
   p = (a + b + c) * 0.5;
   s = sqrt(p * (p - a) * (p - b) * (p - c));//面积

    k = min(k, r);
    k = max(k, l);

    cout << fixed << setprecision(12) << cal(s, k) << endl;

    return 0;
}

吕泽 发表于 2024-5-10 21:26:45

6,但是这标题?      
页: [1]
查看完整版本: P10410 「QFOI R2」寺秋山霭苍苍