結果

問題 No.172 UFOを捕まえろ
ユーザー koukonkokoukonko
提出日時 2015-12-13 15:34:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 654 bytes
コンパイル時間 2,071 ms
コンパイル使用メモリ 74,380 KB
実行使用メモリ 37,104 KB
最終ジャッジ日時 2024-04-23 14:23:21
合計ジャッジ時間 3,524 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
37,076 KB
testcase_01 AC 46 ms
36,528 KB
testcase_02 AC 48 ms
37,036 KB
testcase_03 AC 44 ms
36,828 KB
testcase_04 AC 47 ms
37,000 KB
testcase_05 AC 45 ms
36,768 KB
testcase_06 AC 44 ms
36,896 KB
testcase_07 AC 46 ms
36,392 KB
testcase_08 AC 44 ms
36,828 KB
testcase_09 AC 48 ms
36,772 KB
testcase_10 AC 45 ms
36,644 KB
testcase_11 AC 46 ms
37,104 KB
testcase_12 AC 46 ms
36,916 KB
testcase_13 AC 47 ms
36,980 KB
testcase_14 AC 45 ms
36,520 KB
testcase_15 AC 45 ms
36,876 KB
testcase_16 AC 46 ms
36,392 KB
testcase_17 AC 47 ms
36,912 KB
testcase_18 AC 45 ms
36,620 KB
testcase_19 AC 44 ms
36,768 KB
testcase_20 AC 44 ms
36,944 KB
testcase_21 AC 44 ms
36,940 KB
testcase_22 AC 46 ms
36,768 KB
testcase_23 AC 44 ms
36,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		try {
			String[] box = read.readLine().split(" ");
			int[] cir = new int[3];

			for (int i = 0; i < 3; ++i) {
				cir[i] = Math.abs(Integer.parseInt(box[i]));
			}

			double x = cir[0] + (cir[2] * 1.0 / Math.sqrt(2));
			double y = cir[1] + (cir[2] * 1.0 / Math.sqrt(2));

			int i;
			for (i = 0; true; ++i) {
				if (x + y < i) {
					break;
				}
			}

			System.out.println(i);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
0