結果

問題 No.105 arcの六角ボルト
ユーザー 沙耶花沙耶花
提出日時 2021-10-26 15:44:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 71 ms / 5,000 ms
コード長 1,036 bytes
コンパイル時間 4,522 ms
コンパイル使用メモリ 256,348 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-04-15 14:42:56
合計ジャッジ時間 5,253 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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