結果

問題 No.2352 Sharpened Knife in Fall
ユーザー titiatitia
提出日時 2023-06-16 21:49:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 390 ms / 3,000 ms
コード長 901 bytes
コンパイル時間 434 ms
コンパイル使用メモリ 86,656 KB
実行使用メモリ 80,920 KB
最終ジャッジ日時 2023-09-06 19:19:51
合計ジャッジ時間 12,752 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,440 KB
testcase_01 AC 69 ms
70,980 KB
testcase_02 AC 70 ms
71,360 KB
testcase_03 AC 70 ms
71,184 KB
testcase_04 AC 388 ms
80,804 KB
testcase_05 AC 73 ms
70,840 KB
testcase_06 AC 379 ms
80,620 KB
testcase_07 AC 236 ms
79,304 KB
testcase_08 AC 375 ms
80,916 KB
testcase_09 AC 390 ms
80,636 KB
testcase_10 AC 378 ms
80,696 KB
testcase_11 AC 381 ms
80,748 KB
testcase_12 AC 384 ms
80,720 KB
testcase_13 AC 385 ms
80,652 KB
testcase_14 AC 227 ms
79,396 KB
testcase_15 AC 364 ms
80,920 KB
testcase_16 AC 104 ms
76,868 KB
testcase_17 AC 95 ms
76,980 KB
testcase_18 AC 195 ms
79,216 KB
testcase_19 AC 321 ms
80,056 KB
testcase_20 AC 182 ms
78,884 KB
testcase_21 AC 179 ms
78,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from math import cos ,sin,pi

R,K=map(int,input().split())


if K%2==0:
    ANS=[]

    for tests in range(K//2):       
        OK=pi/2
        NG=0

        for bintrick in range(100):
            mid=(OK+NG)/2

            if (cos(mid)*sin(mid)+mid)/pi>1/(2*(K+1))+tests/(K+1):
                OK=mid
            else:
                NG=mid

        ANS.append(sin(OK)*R)
        ANS.append(-sin(OK)*R)

    ANS.sort()
    for ans in ANS:
        print(ans)

else:
    ANS=[0]

    for tests in range(K//2):       
        OK=pi/2
        NG=0

        for bintrick in range(100):
            mid=(OK+NG)/2

            if (cos(mid)*sin(mid)+mid)/pi>(1+tests)/(K+1):
                OK=mid
            else:
                NG=mid

        ANS.append(sin(OK)*R)
        ANS.append(-sin(OK)*R)

    ANS.sort()
    for ans in ANS:
        print(ans)
    

    
0