結果

問題 No.172 UFOを捕まえろ
ユーザー YamaKasaYamaKasa
提出日時 2018-05-17 23:44:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 3,423 ms
コンパイル使用メモリ 71,500 KB
実行使用メモリ 56,560 KB
最終ジャッジ日時 2023-09-10 22:44:15
合計ジャッジ時間 6,354 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,472 KB
testcase_01 AC 121 ms
55,760 KB
testcase_02 AC 121 ms
55,492 KB
testcase_03 AC 120 ms
53,480 KB
testcase_04 AC 121 ms
55,380 KB
testcase_05 AC 120 ms
55,412 KB
testcase_06 AC 120 ms
55,412 KB
testcase_07 AC 121 ms
55,496 KB
testcase_08 AC 121 ms
55,740 KB
testcase_09 AC 121 ms
56,256 KB
testcase_10 AC 120 ms
55,548 KB
testcase_11 AC 120 ms
55,180 KB
testcase_12 AC 121 ms
55,568 KB
testcase_13 AC 119 ms
55,656 KB
testcase_14 AC 119 ms
56,560 KB
testcase_15 AC 122 ms
55,524 KB
testcase_16 AC 130 ms
55,396 KB
testcase_17 AC 130 ms
55,488 KB
testcase_18 AC 120 ms
55,624 KB
testcase_19 AC 121 ms
55,456 KB
testcase_20 AC 119 ms
55,472 KB
testcase_21 AC 120 ms
55,264 KB
testcase_22 AC 128 ms
55,256 KB
testcase_23 AC 132 ms
55,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		int y = scan.nextInt();
		int r = scan.nextInt();
		scan.close();
		if(x < 0) {
			x = - x;
		}
		if(y < 0) {
			y = - y;
		}
		int k = x + y + (int)(Math.sqrt(2) * r) + 1;


		System.out.println(k);
	}
}
0