結果
問題 | No.105 arcの六角ボルト |
ユーザー | kuuso1 |
提出日時 | 2014-12-16 23:57:00 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,831 bytes |
コンパイル時間 | 3,293 ms |
コンパイル使用メモリ | 109,056 KB |
実行使用メモリ | 23,168 KB |
最終ジャッジ日時 | 2024-06-11 22:04:17 |
合計ジャッジ時間 | 1,766 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
コンパイルメッセージ
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; using myComplex; 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; 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));} } namespace myComplex{ struct Complex{ double re; double im; public static Complex I=new Complex(0,1); public double Re{ get{return this.re;} set{this.re=value;} } public double Im{ get{return this.im;} set{this.im=value;} } public Complex(double a,double b){ re=a;im=b; } public static implicit operator Complex(double a){ return new Complex(a,0); } public static Complex operator+(Complex a,Complex b){ return new Complex(a.Re+b.Re,a.Im+b.Im); } public static Complex operator-(Complex a,Complex b){ return new Complex(a.Re-b.Re,a.Im-b.Im); } public static Complex operator*(Complex a,Complex b){ return new Complex(a.Re*b.Re-a.Im*b.Im,a.Re*b.Im+a.Im*b.Re); } public static Complex operator/(Complex a,Complex b){ return a*(1.0/b.Abs2)*~b; } public static Complex operator~(Complex a){ return new Complex(a.Re,-a.Im); } public double Abs{ get{return Math.Sqrt(this.Abs2);} } public double Abs2{ get{return re*re+im*im;} } public double Arg{ get{return Math.Atan2(im,re);} } public override String ToString(){ return this.Re.ToString()+","+this.Im.ToString(); } public static Complex Exp(Complex a){ return Math.Exp(a.Re)*(new Complex(Math.Cos(a.Im),Math.Sin(a.Im))); } } }