結果
| 問題 |
No.105 arcの六角ボルト
|
| コンテスト | |
| ユーザー |
kuuso1
|
| 提出日時 | 2014-12-17 00:04:12 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 128 ms / 5,000 ms |
| コード長 | 1,511 bytes |
| コンパイル時間 | 1,040 ms |
| コンパイル使用メモリ | 115,404 KB |
| 実行使用メモリ | 31,264 KB |
| 最終ジャッジ日時 | 2024-06-11 22:04:51 |
| 合計ジャッジ時間 | 1,647 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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));}
}
kuuso1