結果

問題 No.1178 Can you draw a Circle?
ユーザー ks2mks2m
提出日時 2020-08-21 22:09:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 2,926 ms
コンパイル使用メモリ 71,428 KB
実行使用メモリ 56,188 KB
最終ジャッジ日時 2023-08-07 10:04:36
合計ジャッジ時間 5,151 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,680 KB
testcase_01 AC 122 ms
55,476 KB
testcase_02 AC 120 ms
56,000 KB
testcase_03 AC 118 ms
55,800 KB
testcase_04 AC 119 ms
55,820 KB
testcase_05 AC 119 ms
55,748 KB
testcase_06 AC 119 ms
55,896 KB
testcase_07 AC 119 ms
55,688 KB
testcase_08 AC 122 ms
55,968 KB
testcase_09 AC 125 ms
55,744 KB
testcase_10 AC 123 ms
55,840 KB
testcase_11 AC 120 ms
56,100 KB
testcase_12 AC 123 ms
55,756 KB
testcase_13 AC 120 ms
55,924 KB
testcase_14 AC 119 ms
55,940 KB
testcase_15 AC 121 ms
56,188 KB
testcase_16 AC 120 ms
55,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		double c = sc.nextInt();
		double d = sc.nextInt();
		double e = sc.nextInt();
		double f = sc.nextInt();
		sc.close();

		if (a != b) {
			System.out.println(0);
			return;
		}

		c /= a;
		d /= a;
		f = (f - e) / a;

		c = c * c / 4;
		d = d * d / 4;
		f = f + c + d;
		System.out.println(Math.sqrt(f));
	}
}
0