結果
問題 | No.605 板挟みの球面 |
ユーザー |
![]() |
提出日時 | 2023-04-10 11:14:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 15 ms / 2,000 ms |
コード長 | 877 bytes |
コンパイル時間 | 4,300 ms |
コンパイル使用メモリ | 251,968 KB |
最終ジャッジ日時 | 2025-02-12 04:32:02 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/all>using namespace std;using namespace atcoder;using ll=long long;using ld=long double;ld pie=3.141592653589793;ll inf=144494;ll mod=1000000007;int main(){ld ans=4.0*pie;ld a,b;cin >> a >> b;if (a>b){swap(a,b);}if (a>=0){ans-=2.0*pie;ans-=2.0*pie*(1.0-a);ld x=2.0*pie;x-=ans;x-=2.0*pie*(1.0-b);cout << setprecision(100) << x << endl;}else{if (b<=0){ans-=2.0*pie;ans-=2.0*pie*(1.0+b);ld x=2.0*pie;x-=ans;x-=2.0*pie*(1.0+a);cout << setprecision(100) << x << endl;}else{ans-=2.0*(1.0+a)*pie;ans-=2.0*(1.0-b)*pie;cout << setprecision(100) << ans << endl;}}}