結果

問題 No.2352 Sharpened Knife in Fall
ユーザー Ricky_ponRicky_pon
提出日時 2023-06-16 21:40:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 338 ms / 3,000 ms
コード長 626 bytes
コンパイル時間 839 ms
コンパイル使用メモリ 86,600 KB
実行使用メモリ 84,932 KB
最終ジャッジ日時 2023-09-06 19:02:57
合計ジャッジ時間 12,389 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,480 KB
testcase_01 AC 70 ms
71,076 KB
testcase_02 AC 68 ms
71,444 KB
testcase_03 AC 69 ms
71,108 KB
testcase_04 AC 338 ms
84,172 KB
testcase_05 AC 68 ms
71,124 KB
testcase_06 AC 328 ms
84,100 KB
testcase_07 AC 203 ms
80,980 KB
testcase_08 AC 322 ms
84,144 KB
testcase_09 AC 332 ms
84,932 KB
testcase_10 AC 320 ms
84,220 KB
testcase_11 AC 335 ms
84,392 KB
testcase_12 AC 328 ms
84,240 KB
testcase_13 AC 328 ms
84,236 KB
testcase_14 AC 196 ms
80,884 KB
testcase_15 AC 311 ms
84,532 KB
testcase_16 AC 97 ms
76,976 KB
testcase_17 AC 89 ms
77,008 KB
testcase_18 AC 171 ms
79,316 KB
testcase_19 AC 268 ms
82,844 KB
testcase_20 AC 163 ms
79,984 KB
testcase_21 AC 158 ms
79,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.readline


def main():
    R, K = map(int, input().split())
    from math import pi, sin, cos

    ans = []
    if K % 2 == 1:
        ans.append(0)
    for t in range(1, K // 2 + 1):
        goal = 2 * pi / (K + 1) * t
        low = 0
        high = goal + 1
        for _ in range(100):
            mid = (high + low) / 2
            if mid - sin(mid) > goal:
                high = mid
            else:
                low = mid

        tmp = R * cos(low / 2)
        ans.append(tmp)
        ans.append(-tmp)

    ans.sort()
    print(*ans, sep="\n")


if __name__ == "__main__":
    main()
0