結果

問題 No.2352 Sharpened Knife in Fall
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-06-16 23:03:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 423 bytes
コンパイル時間 1,170 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 15,188 KB
最終ジャッジ日時 2023-09-06 21:53:40
合計ジャッジ時間 16,249 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,152 KB
testcase_01 AC 16 ms
8,240 KB
testcase_02 AC 17 ms
8,092 KB
testcase_03 AC 17 ms
8,052 KB
testcase_04 TLE -
testcase_05 AC 16 ms
8,196 KB
testcase_06 TLE -
testcase_07 AC 1,928 ms
11,824 KB
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 AC 1,832 ms
11,596 KB
testcase_15 TLE -
testcase_16 AC 198 ms
9,072 KB
testcase_17 AC 99 ms
8,992 KB
testcase_18 AC 1,461 ms
11,160 KB
testcase_19 TLE -
testcase_20 AC 1,191 ms
10,644 KB
testcase_21 AC 1,169 ms
10,636 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