結果

問題 No.2352 Sharpened Knife in Fall
ユーザー navel_tosnavel_tos
提出日時 2023-06-16 21:55:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 460 ms / 3,000 ms
コード長 771 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 87,928 KB
最終ジャッジ日時 2023-09-06 19:33:09
合計ジャッジ時間 13,637 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,384 KB
testcase_01 AC 76 ms
71,384 KB
testcase_02 AC 76 ms
71,700 KB
testcase_03 AC 73 ms
71,712 KB
testcase_04 AC 441 ms
87,800 KB
testcase_05 AC 75 ms
71,908 KB
testcase_06 AC 448 ms
87,808 KB
testcase_07 AC 274 ms
82,144 KB
testcase_08 AC 452 ms
87,872 KB
testcase_09 AC 451 ms
87,852 KB
testcase_10 AC 459 ms
87,816 KB
testcase_11 AC 460 ms
87,764 KB
testcase_12 AC 454 ms
87,928 KB
testcase_13 AC 452 ms
87,796 KB
testcase_14 AC 268 ms
81,456 KB
testcase_15 AC 420 ms
86,980 KB
testcase_16 AC 115 ms
77,716 KB
testcase_17 AC 104 ms
78,104 KB
testcase_18 AC 228 ms
80,680 KB
testcase_19 AC 369 ms
84,872 KB
testcase_20 AC 206 ms
80,020 KB
testcase_21 AC 196 ms
79,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yukicoder393C

'''
やばいね。
二分探索K回やるか。
それか弧度法でやるかだが・・・ちょっと怖いな。まいっか。
'''
import math
R,K=map(int,input().split()); ans=[]; Lt=0; S=0; maxS=R**2*math.pi; P=maxS/(K+1)

#面積計算 第一象限の交点となす角がradのときの面積を求める
def area(rad):
    global R
    r2=90-rad
    x,y=R*math.cos(math.radians(rad)),R*math.sin(math.radians(rad))
    A=(R**2)*math.pi/4-(x*y)/2-(R**2)*math.pi*(r2/360); return A*2

#二分探索をくり返して答えを求める
for i in range(K):
    Rt=180
    while abs(Lt-Rt)>1e-13:
        mid=(Lt+Rt)/2
        Lt,Rt=(mid,Rt) if area(mid)-S<P else (Lt,mid)
    ans.append(R*math.cos(math.radians(Lt))); S+=P
print(*ans[::-1],sep='\n')
0