結果

問題 No.1178 Can you draw a Circle?
ユーザー ks2mks2m
提出日時 2020-08-21 21:51:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 2,034 ms
コンパイル使用メモリ 74,460 KB
実行使用メモリ 41,584 KB
最終ジャッジ日時 2024-04-25 03:56:29
合計ジャッジ時間 5,017 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
41,480 KB
testcase_01 AC 128 ms
41,104 KB
testcase_02 AC 130 ms
41,368 KB
testcase_03 AC 137 ms
41,368 KB
testcase_04 AC 129 ms
41,268 KB
testcase_05 AC 131 ms
41,584 KB
testcase_06 AC 129 ms
41,208 KB
testcase_07 AC 128 ms
41,060 KB
testcase_08 AC 129 ms
41,084 KB
testcase_09 AC 127 ms
41,256 KB
testcase_10 AC 129 ms
41,108 KB
testcase_11 AC 129 ms
41,372 KB
testcase_12 AC 119 ms
40,304 KB
testcase_13 AC 117 ms
39,988 KB
testcase_14 AC 128 ms
41,152 KB
testcase_15 AC 117 ms
40,200 KB
testcase_16 AC 128 ms
41,176 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) {
			throw new Exception();
		}

		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