結果

問題 No.2352 Sharpened Knife in Fall
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-06-16 23:03:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 544 ms / 3,000 ms
コード長 423 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 86,464 KB
実行使用メモリ 86,184 KB
最終ジャッジ日時 2023-09-06 21:51:31
合計ジャッジ時間 14,946 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,524 KB
testcase_01 AC 75 ms
71,172 KB
testcase_02 AC 74 ms
71,504 KB
testcase_03 AC 74 ms
71,164 KB
testcase_04 AC 540 ms
84,364 KB
testcase_05 AC 73 ms
71,248 KB
testcase_06 AC 533 ms
84,592 KB
testcase_07 AC 318 ms
81,280 KB
testcase_08 AC 531 ms
84,776 KB
testcase_09 AC 544 ms
86,184 KB
testcase_10 AC 535 ms
84,352 KB
testcase_11 AC 534 ms
84,692 KB
testcase_12 AC 534 ms
84,512 KB
testcase_13 AC 543 ms
84,468 KB
testcase_14 AC 308 ms
81,356 KB
testcase_15 AC 509 ms
85,648 KB
testcase_16 AC 124 ms
77,724 KB
testcase_17 AC 114 ms
76,972 KB
testcase_18 AC 260 ms
79,552 KB
testcase_19 AC 447 ms
84,400 KB
testcase_20 AC 239 ms
80,584 KB
testcase_21 AC 232 ms
80,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

R,K=map(int,input().split())
ans=[]
from math import acos,sin,pi
def S(x,k):
    alpha = 2*acos((R-x)/R)
    S=(K+1)*(alpha - sin(alpha)) -(2*pi*k)
    return S>=0
for i in range(K//2):
    l=0
    r=R
    for _ in range(100):
        mid=(l+r)/2
        if S(mid,i+1):
            r=mid
        else:
            l=mid
    ans.append(R-l)
    ans.append(-(R-l))
if K%2!=0:
    ans.append(0)
ans.sort()
print(*ans,sep="\n")
0