結果

問題 No.105 arcの六角ボルト
ユーザー IL_mstaIL_msta
提出日時 2015-07-01 09:46:31
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 1,131 bytes
コンパイル時間 600 ms
コンパイル使用メモリ 84,712 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-22 04:56:38
合計ジャッジ時間 1,167 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>

#include <algorithm>
#include <cmath>

#include <string>
#include <list>
#include <queue>
#include <vector>
#include <complex>
#include <set>

/////////
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;
/////////
typedef long long LL;
typedef long double LD;
/////////
using namespace::std;
/////////
LD ansLD[5000];
int main(void){
    std::cin.tie(0); 
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed;//
    //cout << setprecision(7);//
    
    int T;
	cin>>T;

	LD X[6],Y[6];
	
	LD ans = -1;
	LD tans;
	bool bans = false;
	LD kk = 360.0/(2.0*M_PI);
	LD s50 = 50.0 * 2.0*M_PI/360.0;
	LD dy = 0.000000000001;
	for(int Loop=0;Loop<T;++Loop){
		ans = -1;
		bans = false;
		rep(i,6){
			cin>>X[i]>>Y[i];
			if(Y[i] > -dy && X[i] >= 1/2)
			{
				tans = atan2(Y[i],X[i]);
				if( bans == false){
					ans = tans;
					bans = true;
				}
				else{
					if(abs(ans)>abs(tans)){
						ans = tans;
					}
				}
			}
		}
		
		ansLD[Loop] = ans*kk;
	}
	rep(i,T){
		P( ansLD[i] );
	}
    return 0;
}
0