結果

問題 No.2352 Sharpened Knife in Fall
ユーザー miya145592miya145592
提出日時 2023-06-16 23:29:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 348 ms / 3,000 ms
コード長 481 bytes
コンパイル時間 542 ms
コンパイル使用メモリ 87,512 KB
実行使用メモリ 80,244 KB
最終ジャッジ日時 2023-09-06 22:33:14
合計ジャッジ時間 12,358 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,736 KB
testcase_01 AC 77 ms
71,736 KB
testcase_02 AC 72 ms
71,980 KB
testcase_03 AC 72 ms
71,600 KB
testcase_04 AC 289 ms
79,772 KB
testcase_05 AC 74 ms
71,712 KB
testcase_06 AC 343 ms
79,600 KB
testcase_07 AC 225 ms
78,700 KB
testcase_08 AC 346 ms
79,768 KB
testcase_09 AC 346 ms
79,948 KB
testcase_10 AC 334 ms
79,616 KB
testcase_11 AC 336 ms
80,192 KB
testcase_12 AC 346 ms
79,768 KB
testcase_13 AC 348 ms
80,244 KB
testcase_14 AC 217 ms
78,756 KB
testcase_15 AC 310 ms
79,404 KB
testcase_16 AC 125 ms
78,056 KB
testcase_17 AC 118 ms
77,956 KB
testcase_18 AC 194 ms
78,904 KB
testcase_19 AC 295 ms
79,056 KB
testcase_20 AC 179 ms
78,284 KB
testcase_21 AC 179 ms
77,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
R, K = map(int, input().split())
S = math.pi*R*R/(K+1)
ans = []
for k in range(K//2):
    l = 0
    r = R
    while r-l>10**(-6):
        mid = (l+r)/2
        theta = math.acos(mid/R)
        s = math.pi*R*R * theta / math.pi
        s -= mid * R * math.sin(theta)
        if s > S*(k+1):
            l = mid
        else:
            r = mid
    mid = (l+r)/2
    ans.append(mid)

for a in ans:
    print(-a)
if K%2==1:
    print(0)
for a in ans[::-1]:
    print(a)

0