結果

問題 No.172 UFOを捕まえろ
ユーザー kenkooookenkoooo
提出日時 2015-03-26 23:34:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 55 ms / 5,000 ms
コード長 686 bytes
コンパイル時間 2,010 ms
コンパイル使用メモリ 74,844 KB
実行使用メモリ 36,976 KB
最終ジャッジ日時 2024-04-23 13:56:12
合計ジャッジ時間 4,076 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
36,444 KB
testcase_01 AC 53 ms
36,620 KB
testcase_02 AC 53 ms
36,732 KB
testcase_03 AC 52 ms
36,636 KB
testcase_04 AC 51 ms
36,520 KB
testcase_05 AC 52 ms
36,316 KB
testcase_06 AC 50 ms
36,860 KB
testcase_07 AC 51 ms
36,580 KB
testcase_08 AC 50 ms
36,616 KB
testcase_09 AC 50 ms
36,804 KB
testcase_10 AC 50 ms
36,752 KB
testcase_11 AC 52 ms
36,408 KB
testcase_12 AC 50 ms
36,580 KB
testcase_13 AC 50 ms
36,928 KB
testcase_14 AC 52 ms
36,620 KB
testcase_15 AC 51 ms
36,888 KB
testcase_16 AC 53 ms
36,636 KB
testcase_17 AC 53 ms
36,936 KB
testcase_18 AC 53 ms
36,792 KB
testcase_19 AC 53 ms
36,756 KB
testcase_20 AC 55 ms
36,976 KB
testcase_21 AC 53 ms
36,936 KB
testcase_22 AC 54 ms
36,844 KB
testcase_23 AC 51 ms
36,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.IOException;

public class Main {

	public static void main(String[] args) {
		int x = nextInt();
		int y = nextInt();
		int r = nextInt();
		int dist = Math.abs(x) + Math.abs(y) + (int) Math.ceil((double) Math.sqrt(2) * r);
		System.out.println(dist);
	}

	static int nextInt() {
		int c;
		try {
			c = System.in.read();
			while (c != '-' && (c < '0' || c > '9'))
				c = System.in.read();
			if (c == '-')
				return -nextInt();
			int res = 0;
			while (c >= '0' && c <= '9') {
				res = res * 10 + c - '0';
				c = System.in.read();
			}
			return res;
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return -1;
	}

}
0