結果

問題 No.2352 Sharpened Knife in Fall
ユーザー komkompikomkompi
提出日時 2023-06-24 17:32:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 729 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,552 KB
実行使用メモリ 83,056 KB
最終ジャッジ日時 2023-09-14 13:06:39
合計ジャッジ時間 7,213 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,884 KB
testcase_01 AC 72 ms
71,816 KB
testcase_02 AC 71 ms
72,172 KB
testcase_03 AC 75 ms
71,740 KB
testcase_04 WA -
testcase_05 AC 71 ms
71,608 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import math

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

S=R**2*math.pi

s=S/(K+1)

def integrate(x):
    #x=rsintheta
    theta=math.acos(x/R)
    
    sense=R**2*theta
    three=1/2*R**2*math.sin(2*theta)
    
    area=sense-three
    return area
    

ans=[]
used=0
high=R
for i in range(K//2):
    low=0
    
    while high-low>10**-6:
        middle=(high+low)/2
        
        
        temp_s=integrate(middle)-used
        if temp_s<s:
            high=middle
        else:
            low=middle
        
        
        
    
    ans.append(high)
    used+=integrate(middle)
    
rev=[-a for a in ans]

if K%2==0:
    ans=rev+ans
else:
    ans=rev+[0]+ans

ans.sort()

for a in ans:
    print(a)

0