結果

問題 No.172 UFOを捕まえろ
ユーザー TatsuDXTatsuDX
提出日時 2016-09-09 00:13:18
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 343 bytes
コンパイル時間 2,793 ms
コンパイル使用メモリ 74,372 KB
実行使用メモリ 54,204 KB
最終ジャッジ日時 2024-04-27 18:12:18
合計ジャッジ時間 6,244 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
54,092 KB
testcase_01 AC 105 ms
53,012 KB
testcase_02 AC 115 ms
53,744 KB
testcase_03 AC 99 ms
52,584 KB
testcase_04 AC 103 ms
53,100 KB
testcase_05 AC 100 ms
52,804 KB
testcase_06 AC 108 ms
54,084 KB
testcase_07 AC 114 ms
54,188 KB
testcase_08 AC 108 ms
53,104 KB
testcase_09 AC 116 ms
53,852 KB
testcase_10 AC 114 ms
54,012 KB
testcase_11 AC 104 ms
53,060 KB
testcase_12 AC 108 ms
53,312 KB
testcase_13 AC 113 ms
53,992 KB
testcase_14 AC 108 ms
53,840 KB
testcase_15 AC 104 ms
52,944 KB
testcase_16 AC 106 ms
53,856 KB
testcase_17 AC 116 ms
54,076 KB
testcase_18 AC 123 ms
54,204 KB
testcase_19 AC 114 ms
54,032 KB
testcase_20 AC 106 ms
53,164 KB
testcase_21 AC 100 ms
52,848 KB
testcase_22 WA -
testcase_23 AC 110 ms
54,084 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