結果

問題 No.2352 Sharpened Knife in Fall
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-06-16 23:02:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 413 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 16,200 KB
最終ジャッジ日時 2023-09-06 21:49:03
合計ジャッジ時間 4,978 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

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(150):
        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)
0