結果

問題 No.105 arcの六角ボルト
ユーザー kano_townkano_town
提出日時 2014-12-20 19:24:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,542 ms / 5,000 ms
コード長 656 bytes
コンパイル時間 3,227 ms
コンパイル使用メモリ 72,148 KB
実行使用メモリ 65,292 KB
最終ジャッジ日時 2023-09-02 20:09:42
合計ジャッジ時間 6,755 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder105 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double x, y, bx, by, tMax, tMin, theta = 0;
		int t = sc.nextInt();
		for (int i = 0; i < t; i++) {
			x = y = 0;
			for (int j = 0; j < 6; j++) {
				bx = sc.nextDouble() + 1e-12;
				by = sc.nextDouble() + 1e-12;
				if (bx > x && by >= 0) {
					x = bx;
					y = by;
				}
			}
			tMax = 50;
			tMin = 0;
			for (int j = 0; j < 100; j++) {
				theta = (tMax + tMin) / 2.0;
				bx = Math.cos(Math.toRadians(theta));
				if (bx < x) tMax = theta;
				else tMin = theta;
			}
			System.out.println(theta);
		}

	}

}
0