結果

問題 No.172 UFOを捕まえろ
ユーザー mitsuomitsuo
提出日時 2016-05-05 10:18:45
言語 Java19
(openjdk 21)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 689 bytes
コンパイル時間 4,193 ms
コンパイル使用メモリ 72,544 KB
実行使用メモリ 56,132 KB
最終ジャッジ日時 2023-08-05 18:01:46
合計ジャッジ時間 8,062 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,388 KB
testcase_01 AC 129 ms
55,792 KB
testcase_02 AC 132 ms
55,768 KB
testcase_03 AC 132 ms
55,552 KB
testcase_04 AC 130 ms
56,116 KB
testcase_05 AC 127 ms
55,800 KB
testcase_06 AC 128 ms
55,684 KB
testcase_07 AC 127 ms
55,600 KB
testcase_08 AC 128 ms
55,652 KB
testcase_09 AC 126 ms
55,740 KB
testcase_10 AC 128 ms
55,644 KB
testcase_11 AC 126 ms
55,624 KB
testcase_12 AC 131 ms
55,772 KB
testcase_13 AC 126 ms
55,768 KB
testcase_14 AC 128 ms
55,696 KB
testcase_15 AC 130 ms
55,728 KB
testcase_16 AC 128 ms
55,824 KB
testcase_17 AC 128 ms
55,676 KB
testcase_18 AC 130 ms
55,488 KB
testcase_19 AC 126 ms
55,712 KB
testcase_20 AC 131 ms
55,652 KB
testcase_21 AC 130 ms
56,132 KB
testcase_22 AC 130 ms
55,948 KB
testcase_23 AC 132 ms
55,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static final double R2 = Math.pow(2, 0.5);

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> input = new ArrayList<>();
		while (sc.hasNext()) {
			input.add(sc.nextLine());
		}

		System.out.println(solve(input));

		sc.close();
	}

	public static int solve(List<String> in) {
		double x = Double.valueOf(in.get(0).split(" ")[0]);
		double y = Double.valueOf(in.get(0).split(" ")[1]);
		double r = Double.valueOf(in.get(0).split(" ")[2]);

		double D = r * R2 + Math.abs(x) + Math.abs(y);

		return new Double(D).intValue() + 1;
	}
}
0