結果
問題 |
No.724 円と円の間の円
|
ユーザー |
|
提出日時 | 2018-11-18 11:26:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 375 bytes |
コンパイル時間 | 1,701 ms |
コンパイル使用メモリ | 167,064 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 14:52:55 |
合計ジャッジ時間 | 2,907 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; int main(){ int n;double a,b;cin>>n>>a>>b; double a_=1./(2*a),b_=1./(2*b); double t=(a_-b_)/2;//反転後の円の半径 if(n%2==0){ double h=pow((n-1)*t,2)+pow(b_+t,2)-t*t; printf("%.12lf\n",t/h); } else{ double h=pow(n/2*2*t,2)+pow(b_+t,2)-t*t; printf("%.12lf\n",t/h); } }