結果
問題 | No.2352 Sharpened Knife in Fall |
ユーザー | navel_tos |
提出日時 | 2023-06-16 21:55:08 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 447 ms / 3,000 ms |
コード長 | 771 bytes |
コンパイル時間 | 651 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 86,528 KB |
最終ジャッジ日時 | 2024-06-24 13:58:04 |
合計ジャッジ時間 | 12,792 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
#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')