結果

問題 No.2352 Sharpened Knife in Fall
ユーザー yabityabit
提出日時 2023-06-18 11:54:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 460 ms / 3,000 ms
コード長 407 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 78,040 KB
最終ジャッジ日時 2023-09-08 07:32:38
合計ジャッジ時間 15,602 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,316 KB
testcase_01 AC 71 ms
71,572 KB
testcase_02 AC 69 ms
71,524 KB
testcase_03 AC 69 ms
71,468 KB
testcase_04 AC 323 ms
77,668 KB
testcase_05 AC 69 ms
71,424 KB
testcase_06 AC 429 ms
77,820 KB
testcase_07 AC 260 ms
77,928 KB
testcase_08 AC 428 ms
77,684 KB
testcase_09 AC 434 ms
77,684 KB
testcase_10 AC 450 ms
77,980 KB
testcase_11 AC 460 ms
77,828 KB
testcase_12 AC 455 ms
77,792 KB
testcase_13 AC 445 ms
78,040 KB
testcase_14 AC 249 ms
77,688 KB
testcase_15 AC 407 ms
77,800 KB
testcase_16 AC 116 ms
77,088 KB
testcase_17 AC 103 ms
76,832 KB
testcase_18 AC 218 ms
77,912 KB
testcase_19 AC 362 ms
77,712 KB
testcase_20 AC 190 ms
77,480 KB
testcase_21 AC 189 ms
77,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import asin, sin, pi

R, K = map(int, input().split())


def area(l):
    a = asin(l / R)
    return (R * R) * (a + (sin(2 * a) / 2) + (pi / 2))


sa = 10 ** (-6)

for i in range(K):
    goal = R * R * pi * ((i + 1) / (K + 1))
    ok, ng = -R, R
    while ng - ok > sa:
        mid = (ok + ng) / 2
        if area(mid) < goal:
            ok = mid
        else:
            ng = mid
    print(ok)
0