結果
問題 | No.2352 Sharpened Knife in Fall |
ユーザー |
![]() |
提出日時 | 2023-06-18 03:19:31 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 366 ms / 3,000 ms |
コード長 | 596 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 82,436 KB |
実行使用メモリ | 77,484 KB |
最終ジャッジ日時 | 2024-06-25 15:48:37 |
合計ジャッジ時間 | 10,921 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
import mathR, K = map(int, input().split())PI = math.pifor i in range(K):S = PI * R * R * (i+1) / (K+1)ok = -Rng = Rwhile ng - ok > 0.000001:h = (ok + ng) / 2if h < 0:theta = 2 * math.acos(abs(h) / R)else:theta = 2 * (PI - math.acos(abs(h) / R))T = R * R * theta / 2if h < 0:T -= math.sqrt(R * R - h * h) * abs(h)else:T += math.sqrt(R * R - h * h) * abs(h)if S < T:ng = helse:ok = hprint("{:.7f}".format(ok))