結果

問題 No.2352 Sharpened Knife in Fall
ユーザー ニックネームニックネーム
提出日時 2023-06-16 22:52:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,090 ms / 3,000 ms
コード長 353 bytes
コンパイル時間 992 ms
コンパイル使用メモリ 10,836 KB
実行使用メモリ 10,900 KB
最終ジャッジ日時 2023-09-06 21:30:46
合計ジャッジ時間 31,075 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,980 KB
testcase_01 AC 17 ms
8,060 KB
testcase_02 AC 16 ms
7,976 KB
testcase_03 AC 16 ms
7,960 KB
testcase_04 AC 1,934 ms
10,772 KB
testcase_05 AC 16 ms
8,060 KB
testcase_06 AC 1,945 ms
10,784 KB
testcase_07 AC 981 ms
9,692 KB
testcase_08 AC 2,072 ms
10,900 KB
testcase_09 AC 2,090 ms
10,784 KB
testcase_10 AC 2,011 ms
10,756 KB
testcase_11 AC 1,912 ms
10,580 KB
testcase_12 AC 2,005 ms
10,720 KB
testcase_13 AC 2,041 ms
10,756 KB
testcase_14 AC 955 ms
9,336 KB
testcase_15 AC 1,786 ms
10,640 KB
testcase_16 AC 112 ms
7,956 KB
testcase_17 AC 56 ms
7,920 KB
testcase_18 AC 708 ms
9,196 KB
testcase_19 AC 1,547 ms
10,380 KB
testcase_20 AC 605 ms
8,888 KB
testcase_21 AC 563 ms
9,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import cos,sin,pi
r,k = map(int,input().split())
a = []
for i in range(k//2):
    ok = 0; ng = pi/2
    for _ in range(50):
        mid = (ok+ng)/2
        s = (pi-2*mid)/2-cos(mid)*sin(mid)
        if s>pi*(i+1)/(k+1): ok = mid
        else: ng = mid
    a.append(sin(ok))
for v in a: print(-v*r)
if k%2: print(0)
for v in a[::-1]: print(v*r)
0