結果

問題 No.2352 Sharpened Knife in Fall
ユーザー meruuu61779999meruuu61779999
提出日時 2023-06-16 23:30:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,630 ms / 3,000 ms
コード長 510 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 10,800 KB
実行使用メモリ 11,104 KB
最終ジャッジ日時 2023-09-06 22:34:33
合計ジャッジ時間 24,752 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,964 KB
testcase_01 AC 16 ms
7,956 KB
testcase_02 AC 16 ms
7,936 KB
testcase_03 AC 16 ms
8,020 KB
testcase_04 AC 842 ms
10,868 KB
testcase_05 AC 16 ms
7,888 KB
testcase_06 AC 1,544 ms
11,104 KB
testcase_07 AC 783 ms
9,812 KB
testcase_08 AC 1,557 ms
10,864 KB
testcase_09 AC 1,630 ms
10,812 KB
testcase_10 AC 1,512 ms
10,868 KB
testcase_11 AC 1,512 ms
10,864 KB
testcase_12 AC 1,531 ms
10,824 KB
testcase_13 AC 1,496 ms
10,816 KB
testcase_14 AC 601 ms
9,784 KB
testcase_15 AC 1,213 ms
10,752 KB
testcase_16 AC 89 ms
8,668 KB
testcase_17 AC 50 ms
8,000 KB
testcase_18 AC 499 ms
9,412 KB
testcase_19 AC 1,235 ms
10,600 KB
testcase_20 AC 430 ms
9,340 KB
testcase_21 AC 469 ms
9,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

R, k = map(int, input().split())
ans = []
pi = math.pi


def judge(m, s):
    A = R * R * math.acos(m / R)
    B = m * math.sqrt(R * R - m * m)
    return A - B >= s


for i in range(1, k // 2 + 1):
    S = pi * R * R / (k + 1) * i
    ok, ng = 0, R
    while ng - ok > 0.000001:
        mid = (ng + ok) / 2
        if judge(mid, S):
            ok = mid
        else:
            ng = mid
    ans.append(ok)
for el in ans:
    print(-el)
if k % 2:
    print(0)
for el in ans[::-1]:
    print(el)
0