結果
問題 | No.948 Bomb vs Dush |
ユーザー | tko919 |
提出日時 | 2019-12-12 21:22:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 689 bytes |
コンパイル時間 | 1,874 ms |
コンパイル使用メモリ | 164,176 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 16:01:40 |
合計ジャッジ時間 | 3,375 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; //template #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(a);i>(b);i--) #define ALL(v) (v).begin(),(v).end() typedef long long int ll; const int inf = 0x3fffffff; const ll INF = 0x3fffffffffffffff; template<class T> inline bool chmax(T& a,T b){ if(a<b){a=b;return 1;}return 0; } template<class T> inline bool chmin(T& a,T b){ if(a>b){a=b;return 1;}return 0; } //template end int main(){ double r,R; scanf("%lf%lf",&r,&R); double t=2*M_PI-acos((R*R*2-r*r*4)/(R*R*2)); double s=((R+r)*(R+r)-(R-r)*(R-r))*t/2; s+=r*r*M_PI; printf("%.12f\n%.12f\n",t,s); return 0; }