結果

問題 No.2352 Sharpened Knife in Fall
ユーザー shogo314shogo314
提出日時 2023-06-17 10:09:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 728 ms / 3,000 ms
コード長 452 bytes
コンパイル時間 1,516 ms
コンパイル使用メモリ 86,144 KB
実行使用メモリ 84,380 KB
最終ジャッジ日時 2023-09-07 07:33:51
合計ジャッジ時間 18,476 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,240 KB
testcase_01 AC 76 ms
71,412 KB
testcase_02 AC 74 ms
71,392 KB
testcase_03 AC 74 ms
71,260 KB
testcase_04 AC 699 ms
84,092 KB
testcase_05 AC 73 ms
71,644 KB
testcase_06 AC 726 ms
84,068 KB
testcase_07 AC 413 ms
80,264 KB
testcase_08 AC 719 ms
84,176 KB
testcase_09 AC 725 ms
84,236 KB
testcase_10 AC 724 ms
83,908 KB
testcase_11 AC 725 ms
84,104 KB
testcase_12 AC 728 ms
84,040 KB
testcase_13 AC 727 ms
84,128 KB
testcase_14 AC 394 ms
80,176 KB
testcase_15 AC 689 ms
84,380 KB
testcase_16 AC 138 ms
77,924 KB
testcase_17 AC 120 ms
77,612 KB
testcase_18 AC 330 ms
79,728 KB
testcase_19 AC 587 ms
82,464 KB
testcase_20 AC 296 ms
78,732 KB
testcase_21 AC 287 ms
79,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
R, K = map(int, input().split())
s = math.pi*R**2
ans = []
for i in range(K):
    goal = s*(i+1)/(K+1)
    x = 0
    y = 2*R
    for i in range(100):
        z = (x+y)/2
        theta = math.acos(1-z/R)
        c = math.sqrt(z*(2*R-z))
        t = theta*R**2-(R-z)*c
        # print(f"z={z}, theta={theta}, c={c}, t={t}")
        if t > goal:
            y = z
        else:
            x = z
    ans.append(x-R)
for a in ans:
    print(a)
0