結果

問題 No.105 arcの六角ボルト
ユーザー リチウムリチウム
提出日時 2014-12-17 00:24:38
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 784 bytes
コンパイル時間 5,032 ms
コンパイル使用メモリ 74,352 KB
実行使用メモリ 73,424 KB
最終ジャッジ日時 2023-09-02 15:33:17
合計ジャッジ時間 9,099 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.Math.*;
public class ppp {
		
  public static void main(String[] args) {
	  Scanner sc=new Scanner(System.in);
	  double eps=0.000000000001;
	  int t=sc.nextInt();
	  for(int p=0;p<t;p++){
	  bi:for(int i=0;i<6;i++){
		  double x=sc.nextDouble();
		  double y=sc.nextDouble();
		  double min=0;
		  double max=Math.PI/3;
		  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;
				  System.out.println(ans*180/Math.PI);
				  break bi;
			  }
			  if(nx-eps>x || ny+eps<y)min=mid;
			  else max=mid;
		  }
	  }
	  
	  }
	 
  }}
0