結果
| 問題 |
No.105 arcの六角ボルト
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-17 01:15:23 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 1,605 ms / 5,000 ms |
| コード長 | 919 bytes |
| コンパイル時間 | 4,053 ms |
| コンパイル使用メモリ | 77,176 KB |
| 実行使用メモリ | 51,744 KB |
| 最終ジャッジ日時 | 2024-06-11 22:39:31 |
| 合計ジャッジ時間 | 7,434 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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++){
for(int i=0;i<6;i++){
double x=sc.nextDouble();
double y=sc.nextDouble();
if(0.5<=x && 0<=y && Math.pow(3,2)/2>=y){
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;
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]);
}
}}