結果
| 問題 | No.605 板挟みの球面 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-05 00:18:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 746 bytes |
| 記録 | |
| コンパイル時間 | 893 ms |
| コンパイル使用メモリ | 93,864 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-28 06:37:53 |
| 合計ジャッジ時間 | 1,358 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 4 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:32:21: warning: 'ans' is used uninitialized [-Wuninitialized]
32 | ans += sqrt((long double)1 - a*a)*3.1415926535 * 2;
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:28:21: note: 'ans' was declared here
28 | long double ans;
| ^~~
ソースコード
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "iomanip"
#include "cmath"
using namespace std;
const long long int MOD = 1000000007;
long long int N, M, K, H, W, L, R;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
long double a, b;
cin >> a >> b;
a = max(a, (long double) - 1);
b = min(b, (long double)1);
long double ans;
long double box = (b - a) / 100000;
long double c = a;
for(int i=0;i<100000;i++){
ans += sqrt((long double)1 - a*a)*3.1415926535 * 2;
a += box;
}
ans /= 100000;
ans *= (b - c);
ans *= 1.27323145;
cout << setprecision(20) << ans << endl;
return 0;
}