結果

問題 No.2352 Sharpened Knife in Fall
ユーザー sepa38sepa38
提出日時 2023-06-16 21:35:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 398 ms / 3,000 ms
コード長 444 bytes
コンパイル時間 657 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 85,748 KB
最終ジャッジ日時 2023-09-06 18:55:02
合計ジャッジ時間 13,186 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,676 KB
testcase_01 AC 73 ms
71,400 KB
testcase_02 AC 71 ms
71,656 KB
testcase_03 AC 72 ms
71,408 KB
testcase_04 AC 368 ms
85,620 KB
testcase_05 AC 71 ms
71,216 KB
testcase_06 AC 382 ms
85,292 KB
testcase_07 AC 242 ms
79,944 KB
testcase_08 AC 386 ms
85,184 KB
testcase_09 AC 391 ms
85,444 KB
testcase_10 AC 385 ms
85,292 KB
testcase_11 AC 394 ms
85,204 KB
testcase_12 AC 398 ms
85,344 KB
testcase_13 AC 398 ms
85,748 KB
testcase_14 AC 247 ms
80,328 KB
testcase_15 AC 369 ms
85,420 KB
testcase_16 AC 130 ms
77,704 KB
testcase_17 AC 120 ms
77,564 KB
testcase_18 AC 218 ms
79,596 KB
testcase_19 AC 330 ms
82,808 KB
testcase_20 AC 194 ms
80,356 KB
testcase_21 AC 188 ms
80,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
r, k = map(int, input().split())
s = r ** 2 * math.pi
ans = []
if k % 2:
  ans.append(0)
for i in range(1, k//2+1):
  t = s / (k + 1) * i
  d, u = 0, r
  for _ in range(50):
    piv = (d + u) / 2
    phi = math.asin(piv/r)
    theta = math.pi - phi * 2
    x = s * theta / (math.pi * 2) - piv * r * math.cos(phi)
    if x > t:
      d = piv
    else:
      u = piv
  ans.append(d)
  ans.append(-d)
ans.sort()
print(*ans, sep = "\n")
0