結果

問題 No.172 UFOを捕まえろ
ユーザー mitsuomitsuo
提出日時 2016-05-05 10:18:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 689 bytes
コンパイル時間 2,703 ms
コンパイル使用メモリ 77,004 KB
実行使用メモリ 41,764 KB
最終ジャッジ日時 2024-04-23 14:49:48
合計ジャッジ時間 6,765 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,448 KB
testcase_01 AC 127 ms
41,512 KB
testcase_02 AC 133 ms
41,356 KB
testcase_03 AC 128 ms
41,104 KB
testcase_04 AC 130 ms
41,284 KB
testcase_05 AC 115 ms
39,972 KB
testcase_06 AC 132 ms
41,084 KB
testcase_07 AC 130 ms
41,312 KB
testcase_08 AC 132 ms
41,540 KB
testcase_09 AC 130 ms
41,096 KB
testcase_10 AC 113 ms
40,068 KB
testcase_11 AC 129 ms
41,456 KB
testcase_12 AC 132 ms
41,056 KB
testcase_13 AC 131 ms
41,464 KB
testcase_14 AC 128 ms
41,432 KB
testcase_15 AC 128 ms
41,764 KB
testcase_16 AC 134 ms
41,696 KB
testcase_17 AC 130 ms
41,416 KB
testcase_18 AC 130 ms
41,052 KB
testcase_19 AC 132 ms
41,300 KB
testcase_20 AC 130 ms
41,064 KB
testcase_21 AC 132 ms
41,680 KB
testcase_22 AC 133 ms
41,428 KB
testcase_23 AC 131 ms
41,452 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