結果

問題 No.105 arcの六角ボルト
ユーザー chocoruskchocorusk
提出日時 2020-10-03 12:06:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 850 ms / 5,000 ms
コード長 660 bytes
コンパイル時間 2,086 ms
コンパイル使用メモリ 72,200 KB
実行使用メモリ 63,432 KB
最終ジャッジ日時 2023-09-25 05:02:28
合計ジャッジ時間 4,260 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.io.PrintWriter;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int T=Integer.parseInt(scanner.next());
		final double PI=Math.PI;
		final double EPS=1e-3;
		for(int z=0; z<T; z++) {
			double ans=0;
			for(int i=0; i<6; i++) {
				double x=Double.parseDouble(scanner.next());
				double y=Double.parseDouble(scanner.next());
				double t=Math.atan2(y, x);
				t-=PI/3;
				if(t>-EPS && t<PI/3-EPS) {
					ans=t/PI*180;
				}
			}
			out.println(String.format("%.7f", ans));
		}
		out.close();
		scanner.close();
	}
}
0