結果

問題 No.2352 Sharpened Knife in Fall
ユーザー rlangevinrlangevin
提出日時 2023-06-16 21:42:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 387 ms / 3,000 ms
コード長 514 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 85,808 KB
最終ジャッジ日時 2023-09-06 19:06:19
合計ジャッジ時間 12,743 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,556 KB
testcase_01 AC 72 ms
70,940 KB
testcase_02 AC 73 ms
71,636 KB
testcase_03 AC 76 ms
70,928 KB
testcase_04 AC 385 ms
85,448 KB
testcase_05 AC 72 ms
71,192 KB
testcase_06 AC 384 ms
85,164 KB
testcase_07 AC 241 ms
81,256 KB
testcase_08 AC 386 ms
85,148 KB
testcase_09 AC 380 ms
85,672 KB
testcase_10 AC 378 ms
85,184 KB
testcase_11 AC 385 ms
85,344 KB
testcase_12 AC 387 ms
85,320 KB
testcase_13 AC 387 ms
85,192 KB
testcase_14 AC 233 ms
81,188 KB
testcase_15 AC 370 ms
85,808 KB
testcase_16 AC 112 ms
78,028 KB
testcase_17 AC 103 ms
77,308 KB
testcase_18 AC 200 ms
79,600 KB
testcase_19 AC 323 ms
83,372 KB
testcase_20 AC 185 ms
79,168 KB
testcase_21 AC 180 ms
79,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import *

def calc(S):
    yes = 1
    no = -1
    for _ in range(60):
        mid = (yes + no)/2
        alpha = asin(mid)
        s = pi/2 - alpha - sin(2 * alpha)/2
        if s <= S:
            yes = mid
        else:
            no = mid
    return yes

R, K = map(int, input().split())
P = []
for i in range(K//2):
    P.append(calc(pi/(K + 1) * (i + 1)))
ans = []
if K % 2:
    ans.append(0)
for p in P:
    ans.append(p * R)
    ans.append(-p * R)
    
ans.sort()
for a in ans:
    print(a)
    
0