結果
| 問題 |
No.948 Bomb vs Dush
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-11 03:09:35 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 305 bytes |
| コンパイル時間 | 533 ms |
| コンパイル使用メモリ | 30,720 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-24 06:31:37 |
| 合計ジャッジ時間 | 1,278 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%lf%lf", &r, &R);
| ~~~~~^~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
constexpr double pi = acos(-1);
int main() {
double r, R, theta;
scanf("%lf%lf", &r, &R);
theta = 2 * pi - 2 * asin(r / R);
printf("%.20lf\n", theta);
printf("%.20lf\n", pi * ((R + r) * (R + r) - (R - r) * (R - r)) * (theta / (2 * pi)) + pi * r * r);
}