結果

問題 No.2352 Sharpened Knife in Fall
ユーザー flygonflygon
提出日時 2023-06-16 23:30:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 941 ms / 3,000 ms
コード長 549 bytes
コンパイル時間 736 ms
コンパイル使用メモリ 87,344 KB
実行使用メモリ 104,132 KB
最終ジャッジ日時 2023-09-06 22:34:08
合計ジャッジ時間 19,030 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,724 KB
testcase_01 AC 71 ms
71,384 KB
testcase_02 AC 72 ms
71,696 KB
testcase_03 AC 72 ms
71,088 KB
testcase_04 AC 941 ms
102,216 KB
testcase_05 AC 72 ms
71,252 KB
testcase_06 AC 904 ms
102,180 KB
testcase_07 AC 506 ms
89,276 KB
testcase_08 AC 918 ms
102,256 KB
testcase_09 AC 911 ms
104,132 KB
testcase_10 AC 904 ms
102,268 KB
testcase_11 AC 907 ms
102,524 KB
testcase_12 AC 903 ms
102,284 KB
testcase_13 AC 914 ms
102,400 KB
testcase_14 AC 485 ms
89,584 KB
testcase_15 AC 862 ms
103,136 KB
testcase_16 AC 142 ms
78,280 KB
testcase_17 AC 118 ms
77,996 KB
testcase_18 AC 390 ms
85,876 KB
testcase_19 AC 737 ms
98,028 KB
testcase_20 AC 349 ms
83,296 KB
testcase_21 AC 346 ms
84,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import acos, degrees, pi
R,K = map(int,input().split())
S = pi*R*R

ans = [R]
for i in range((K)//2):
    now = (i+1)*S/(K+1)
    l = 0
    r = R
    for _ in range(100):
        y = (r+l)/2
        xx = R*R - y*y
        th = degrees(acos((-xx+y*y)/(R*R)))
        s = S*th/360 - (pow(xx, 0.5))*y
        if s <= now:
            r = y
        else:
            l = y
    ans.append(r)
if K % 2 == 1:
    ans.append(0)
new = set()
for i in range(1, len(ans)):
    new.add(ans[i])
    new.add(-ans[i])
print(*sorted(list(new)), sep = "\n")
0