結果

問題 No.948 Bomb vs Dush
ユーザー ningenMe
提出日時 2019-12-08 16:42:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-06-23 07:16:40
合計ジャッジ時間 2,572 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
r =float(input())
R =float(input())
#余弦定理でcosを求める
c = (R*R+R*R-4*r*r)/(2*R*R)
#時間t'を求める
t = 2*math.pi-math.acos(c)
#弧度法に直す
theta = t*180/math.pi
#半径R+rの円とR-rの円の差分を求め、角度から比率を計算し面積を求める。
area = math.pi*((R+r)*(R+r)-(R-r)*(R-r))*theta/360.
#また半径rの円の面積も足す。
area += math.pi*r*r
print(t)
print(area)
0