結果

問題 No.605 板挟みの球面
ユーザー hiro71687khiro71687k
提出日時 2023-04-10 11:14:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 877 bytes
コンパイル時間 4,752 ms
コンパイル使用メモリ 255,356 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-04-15 17:42:00
合計ジャッジ時間 4,960 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 3 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
        }
    }
    
}
0