結果
問題 | No.1319 最強とんがりコーン |
ユーザー |
![]() |
提出日時 | 2020-12-16 01:37:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,021 ms / 2,000 ms |
コード長 | 568 bytes |
コンパイル時間 | 3,190 ms |
コンパイル使用メモリ | 191,832 KB |
最終ジャッジ日時 | 2025-01-17 01:39:22 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 70 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)#define REP(i, n) FOR(i,0,n)int main(){double R, H, D;cin >> R >> H >> D;constexpr int Z = 1 << 25;double dz = 1.0 / Z;double ret = 0.0;REP(t, Z) {double u = dz * (0.5 + t);if (D / (2 * R) > u) continue;double theta = acos(D / (2 * R) / u);ret += u * u * (theta * 0.5 - sin(theta * 2) * 0.25);}cout << fixed << setprecision(20) << ret / Z * 4 * R * R * H << '\n';}