結果

問題 No.105 arcの六角ボルト
ユーザー face4face4
提出日時 2018-09-04 10:27:17
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 71 ms / 5,000 ms
コード長 719 bytes
コンパイル時間 573 ms
コンパイル使用メモリ 74,944 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-04-20 23:02:36
合計ジャッジ時間 1,206 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;

const double EPS = 0.00001;
const double PI = 2 * acos(0.0);
#define Equals(a,b) abs(a-b) < EPS
#define inRange(x,a,b) a <= x && x <= b

int main(){
    int n;
    cin >> n;
    while(n-- > 0){
        double x, y;
        cin >> x >> y;
        double ans = atan2(y, x);
        ans = ans / PI * 180;
        
        // dump
        for(int i = 0; i < 5; i++)  cin >> x >> y;

        while(ans < 0 || ans > 50.0){
            if(Equals(ans, 0.0))    break;
            ans += 60.0;
            if(ans > 360.0 || Equals(ans, 360.0)) ans -= 360.0;
        }
        cout << fixed << setprecision(10) << abs(ans) << endl;
    }

    return 0;
}
0