結果
| 問題 |
No.105 arcの六角ボルト
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-17 01:00:02 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 1,696 ms / 5,000 ms |
| コード長 | 925 bytes |
| コンパイル時間 | 3,489 ms |
| コンパイル使用メモリ | 77,316 KB |
| 実行使用メモリ | 71,360 KB |
| 最終ジャッジ日時 | 2024-06-11 22:33:37 |
| 合計ジャッジ時間 | 7,527 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
import java.util.*;
import java.lang.Math.*;
public class ppp {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
double eps=10E-12;
int t=sc.nextInt();
double ansh[]=new double[t];
for(int p=0;p<t;p++){
boolean ok=false;
for(int i=0;i<6;i++){
double x=sc.nextDouble();
double y=sc.nextDouble();
if(ok)continue;
double min=0;
double max=50*Math.PI/180;
double ans=0;
for(int j=0;j<100;j++){
double mid=(min+max)/2;
double nx=1*Math.cos(mid)-0*Math.sin(mid);
double ny=1*Math.sin(mid)+0*Math.cos(mid);
if(nx-eps<=x && nx+eps>=x && ny-eps<=y && ny+eps>=y){
ans=mid;
ansh[p]=ans*180/Math.PI;
ok=true;
break;
}
if(nx-eps>x || ny+eps<y)min=mid;
else max=mid;
}
}
}
for(int i=0;i<t;i++){
System.out.println(ansh[i]);
}
}}