結果

問題 No.105 arcの六角ボルト
ユーザー IrmystpIrmystp
提出日時 2014-12-16 23:53:12
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 872 bytes
コンパイル時間 1,233 ms
コンパイル使用メモリ 144,144 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-02 15:30:39
合計ジャッジ時間 1,912 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

const int INF = 1000000007;
const int MOD = 1000000007;

const double EPS = 1e-11;

const double PI = acos(-1);

typedef long long ll;


int main(){
    int n;
    cin >> n;
    while(n--){
        double a[6], b[6];
        for(int i = 0; i < 6; i++){
            cin >> a[i] >> b[i];
        }
        double left = 0, right = 50;
        for(int _ = 0; _ < 250; _++){
            double mid = (left + right) / 2;
            double ra = mid * PI / 180.0;
            double x = cos(ra);
            for(int i = 0; i < 6; i++){
                if(a[i] < 0.5 || b[i] < 0) continue;
                if(x - a[i] < -EPS) right = mid;
                else if(x - a[i] > EPS)  left = mid;
                break;
            }
        }
        printf("%.12lf\n", left);
    }
    return 0;
}
0