結果

問題 No.172 UFOを捕まえろ
ユーザー TatsuDXTatsuDX
提出日時 2016-09-09 00:15:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 344 bytes
コンパイル時間 3,250 ms
コンパイル使用メモリ 74,928 KB
実行使用メモリ 54,280 KB
最終ジャッジ日時 2024-04-27 18:12:37
合計ジャッジ時間 6,371 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
53,740 KB
testcase_01 AC 114 ms
53,672 KB
testcase_02 AC 118 ms
53,856 KB
testcase_03 AC 108 ms
53,900 KB
testcase_04 AC 98 ms
52,960 KB
testcase_05 AC 114 ms
53,584 KB
testcase_06 AC 117 ms
54,140 KB
testcase_07 AC 116 ms
53,732 KB
testcase_08 AC 110 ms
52,896 KB
testcase_09 AC 116 ms
54,124 KB
testcase_10 AC 115 ms
54,072 KB
testcase_11 AC 100 ms
54,280 KB
testcase_12 AC 112 ms
53,668 KB
testcase_13 AC 114 ms
53,932 KB
testcase_14 AC 116 ms
53,872 KB
testcase_15 AC 100 ms
52,440 KB
testcase_16 AC 109 ms
53,984 KB
testcase_17 AC 118 ms
53,932 KB
testcase_18 AC 125 ms
54,048 KB
testcase_19 AC 99 ms
54,116 KB
testcase_20 AC 115 ms
54,044 KB
testcase_21 AC 125 ms
54,028 KB
testcase_22 AC 111 ms
53,788 KB
testcase_23 AC 114 ms
53,624 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