結果
| 問題 |
No.105 arcの六角ボルト
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-04 10:27:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 67 ms / 5,000 ms |
| コード長 | 719 bytes |
| コンパイル時間 | 912 ms |
| コンパイル使用メモリ | 74,732 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-12 21:26:43 |
| 合計ジャッジ時間 | 1,501 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
#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;
}