結果
| 問題 |
No.105 arcの六角ボルト
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2021-10-26 15:44:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 86 ms / 5,000 ms |
| コード長 | 1,036 bytes |
| コンパイル時間 | 4,744 ms |
| コンパイル使用メモリ | 252,532 KB |
| 最終ジャッジ日時 | 2025-01-25 07:16:06 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000
int main(){
vector<pair<double,double>> p = {
make_pair(-0.5000000000001114,0.8660254037853874),
make_pair(0.5000000000008891 ,-0.8660254037846875),
make_pair(-0.9999999999992328 ,0.0000000000005249),
make_pair(-0.5000000000002304 ,-0.8660254037850550),
make_pair(0.4999999999997271 ,0.8660254037847375),
make_pair(0.9999999999999735, 0.0000000000000955)
};
double eps = 1e-9;
int _t;
cin>>_t;
rep(_,_t){
//sort(p.begin(),p.end());
vector<pair<double,double>> pp(6);
rep(i,6)cin>>pp[i].first>>pp[i].second;
double ans = 1e100;
double temp = atan2(pp[0].second,pp[0].first);
rep(i,6){
double t2 = atan2(p[i].second,p[i].first);
t2 = temp - t2;
while(t2<-eps)t2 += acos(-1.0)*2.0;
ans = min(ans,t2);
}
ans = 360.0 * ans / (acos(-1.0)*2.0);
cout<<fixed<<setprecision(10)<<ans<<endl;
}
return 0;
}
沙耶花