結果

問題 No.2352 Sharpened Knife in Fall
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-06-16 21:54:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 522 ms / 3,000 ms
コード長 571 bytes
コンパイル時間 354 ms
コンパイル使用メモリ 87,420 KB
実行使用メモリ 87,956 KB
最終ジャッジ日時 2023-09-06 19:31:49
合計ジャッジ時間 14,253 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,956 KB
testcase_01 AC 72 ms
72,016 KB
testcase_02 AC 73 ms
72,156 KB
testcase_03 AC 73 ms
72,028 KB
testcase_04 AC 397 ms
86,408 KB
testcase_05 AC 72 ms
72,016 KB
testcase_06 AC 518 ms
86,908 KB
testcase_07 AC 313 ms
81,804 KB
testcase_08 AC 522 ms
86,752 KB
testcase_09 AC 514 ms
86,804 KB
testcase_10 AC 505 ms
87,868 KB
testcase_11 AC 505 ms
87,648 KB
testcase_12 AC 514 ms
87,956 KB
testcase_13 AC 500 ms
87,220 KB
testcase_14 AC 281 ms
80,660 KB
testcase_15 AC 472 ms
86,808 KB
testcase_16 AC 128 ms
78,212 KB
testcase_17 AC 115 ms
78,000 KB
testcase_18 AC 254 ms
80,132 KB
testcase_19 AC 432 ms
84,396 KB
testcase_20 AC 227 ms
80,544 KB
testcase_21 AC 233 ms
80,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin
import math

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

c = R * R * math.pi
ans = []

for pi in range(1,K+1):

    size = c / (K+1) * pi
    
    yl = 0
    yr = R

    while yr - yl > 10**(-9):

        ym = (yl + yr) / 2

        rad = math.acos(ym/R)

        xlen = R * math.sin(rad)

        nsize = c * rad * 2 / (2*math.pi) - ym * xlen

        if nsize > size:
            yl = ym
        else:
            yr = ym
    
    ans.append(yl)

for i in range(K):
    if i < K // 2:
        ans[K-1-i] = -ans[i]

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