結果
| 問題 |
No.948 Bomb vs Dush
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-31 07:16:02 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 290 bytes |
| コンパイル時間 | 2,654 ms |
| コンパイル使用メモリ | 190,496 KB |
| 最終ジャッジ日時 | 2025-01-10 19:59:06 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:26: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | double r,R; scanf("%lf%lf",&r,&R);
| ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const double PI=acos(-1);
int main(){
double r,R; scanf("%lf%lf",&r,&R);
double theta=2*PI-2*asin(r/R);
printf("%.9f\n%.9f\n",theta,PI*((R+r)*(R+r)-(R-r)*(R-r))*theta/(2*PI)+PI*r*r);
return 0;
}