結果

問題 No.1319 最強とんがりコーン
ユーザー KudeKude
提出日時 2020-12-16 13:17:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 562 bytes
コンパイル時間 1,969 ms
コンパイル使用メモリ 194,172 KB
最終ジャッジ日時 2025-01-17 01:55:46
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 20 WA * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(12);
    double rmax, h, d;
    cin >> rmax >> h >> d;
    const double rmin = d / 2;
    const double rstep = (rmax - rmin) / 5e7;
    double ans = 0;
    for(double r = rmin; r < rmax; r += rstep) {
        double t = acos(d / 2 / r);
        double x = 2 * t;
        double x2 = x * x;
        ans += r * r * (x2 * x / 6 * (1 - x2 / 20 * (1 - x2 / 42)));
    }
    ans *= rstep * h / rmax;
    cout << ans << endl;
}
0