結果

問題 No.105 arcの六角ボルト
ユーザー kuuso1kuuso1
提出日時 2014-12-17 00:04:12
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 168 ms / 5,000 ms
コード長 1,511 bytes
コンパイル時間 4,303 ms
コンパイル使用メモリ 100,556 KB
実行使用メモリ 27,204 KB
最終ジャッジ日時 2023-09-02 15:32:09
合計ジャッジ時間 3,928 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 168 ms
27,204 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		double eps=1e-12;
		for(;T>0;T--){
			List<Pair> L=new List<Pair>();
			rs();
			for(int i=0;i<6;i++){
				var d=rda();
				L.Add(new Pair(d[0],d[1]));
			}
			L.Sort((x,y)=>(x.X>y.X?-1:x.X<y.X?1:0));
			if(Math.Abs(L[0].X-L[1].X)<eps){
				Console.WriteLine(30);
				continue;
			}
			if(L[0].Y>-eps){
				double ans=Math.Atan2(L[0].Y,L[0].X)*180.0/Math.PI;
				Console.WriteLine(ans);
				continue;
			}
			double ans2=60+Math.Atan2(L[0].Y,L[0].X)*180.0/Math.PI;
			if(Math.Abs(ans2-60)<eps)ans2=0.0;
			Console.WriteLine(ans2);
		}
		
	}
	int T;
	public Sol(){
		T=ri();
	}

	class Pair{
		public double X;
		public double Y;
		public Pair(double x_,double y_){
			X=x_;Y=y_;
		}
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0