結果
問題 | No.105 arcの六角ボルト |
ユーザー |
![]() |
提出日時 | 2020-10-03 12:06:42 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 730 ms / 5,000 ms |
コード長 | 660 bytes |
コンパイル時間 | 1,774 ms |
コンパイル使用メモリ | 81,240 KB |
実行使用メモリ | 61,160 KB |
最終ジャッジ日時 | 2024-07-18 04:17:33 |
合計ジャッジ時間 | 3,569 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
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();}}