結果

問題 No.172 UFOを捕まえろ
ユーザー TatsuDXTatsuDX
提出日時 2016-09-09 00:15:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 114 ms / 5,000 ms
コード長 344 bytes
コンパイル時間 2,749 ms
コンパイル使用メモリ 71,644 KB
実行使用メモリ 56,692 KB
最終ジャッジ日時 2023-08-10 00:07:44
合計ジャッジ時間 6,460 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
55,944 KB
testcase_01 AC 106 ms
56,692 KB
testcase_02 AC 106 ms
55,532 KB
testcase_03 AC 105 ms
56,104 KB
testcase_04 AC 102 ms
55,904 KB
testcase_05 AC 105 ms
55,732 KB
testcase_06 AC 106 ms
55,964 KB
testcase_07 AC 108 ms
56,208 KB
testcase_08 AC 107 ms
56,032 KB
testcase_09 AC 106 ms
55,920 KB
testcase_10 AC 105 ms
55,624 KB
testcase_11 AC 105 ms
55,576 KB
testcase_12 AC 104 ms
55,812 KB
testcase_13 AC 109 ms
55,840 KB
testcase_14 AC 111 ms
55,996 KB
testcase_15 AC 114 ms
55,880 KB
testcase_16 AC 110 ms
55,300 KB
testcase_17 AC 109 ms
56,004 KB
testcase_18 AC 105 ms
55,984 KB
testcase_19 AC 104 ms
55,580 KB
testcase_20 AC 108 ms
55,628 KB
testcase_21 AC 108 ms
56,000 KB
testcase_22 AC 109 ms
55,888 KB
testcase_23 AC 109 ms
56,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt(), y = sc.nextInt(), r = sc.nextInt(), z = 0, w;
		if(x < 0){x *= -1;}
		if(y < 0){y *= -1;}
		while(z*z*2 <= r*r){z++;}
		w = z;
		if(z*(z-1)*2 >= r*r){w--;}
		System.out.println(x+y+z+w);
	}
}
0