結果

問題 No.724 円と円の間の円
ユーザー 37zigen37zigen
提出日時 2018-08-06 00:43:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 610 bytes
コンパイル時間 2,414 ms
コンパイル使用メモリ 75,284 KB
実行使用メモリ 58,016 KB
最終ジャッジ日時 2023-10-19 22:07:05
合計ジャッジ時間 7,101 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 149 ms
58,016 KB
testcase_01 AC 153 ms
57,864 KB
testcase_02 AC 153 ms
57,720 KB
testcase_03 AC 153 ms
57,824 KB
testcase_04 AC 153 ms
57,400 KB
testcase_05 AC 154 ms
57,856 KB
testcase_06 AC 152 ms
57,880 KB
testcase_07 AC 151 ms
57,588 KB
testcase_08 AC 153 ms
55,752 KB
testcase_09 AC 150 ms
57,904 KB
testcase_10 AC 148 ms
57,876 KB
testcase_11 AC 150 ms
57,804 KB
testcase_12 AC 154 ms
57,340 KB
testcase_13 AC 160 ms
57,500 KB
testcase_14 AC 152 ms
57,848 KB
testcase_15 AC 152 ms
57,428 KB
testcase_16 AC 156 ms
55,844 KB
testcase_17 AC 152 ms
57,744 KB
testcase_18 AC 157 ms
57,808 KB
testcase_19 AC 158 ms
57,320 KB
testcase_20 AC 157 ms
57,732 KB
testcase_21 AC 157 ms
57,956 KB
testcase_22 AC 153 ms
55,900 KB
testcase_23 AC 154 ms
57,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		double a = sc.nextDouble();
		double b = sc.nextDouble();
		double r = 1 / (4 * a) - 1 / (4 * b);
		double h = (n - 1) * r;
		double m = 1 / (4 * a) + 1 / (4 * b);
		double r2 = 0.5 * (1 / (Math.sqrt(h * h + m * m) - r) - 1 / (Math.sqrt(h * h + m * m) + r));
		System.out.println(String.format("%.20f", r2));
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}
0