結果

問題 No.172 UFOを捕まえろ
ユーザー koukonko
提出日時 2015-12-13 15:34:17
言語 Java
(openjdk 23)
結果
AC  
実行時間 53 ms / 5,000 ms
コード長 654 bytes
コンパイル時間 2,036 ms
コンパイル使用メモリ 73,888 KB
実行使用メモリ 37,060 KB
最終ジャッジ日時 2024-10-15 14:34:16
合計ジャッジ時間 4,131 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

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