結果

問題 No.131 マンハッタン距離
ユーザー kanra661kanra661
提出日時 2015-01-20 23:55:51
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 406 bytes
コンパイル時間 3,403 ms
コンパイル使用メモリ 72,660 KB
実行使用メモリ 58,168 KB
最終ジャッジ日時 2023-09-05 02:35:37
合計ジャッジ時間 9,590 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
56,000 KB
testcase_01 WA -
testcase_02 AC 128 ms
55,940 KB
testcase_03 AC 128 ms
56,148 KB
testcase_04 AC 127 ms
55,836 KB
testcase_05 AC 127 ms
56,036 KB
testcase_06 AC 126 ms
55,928 KB
testcase_07 AC 127 ms
55,844 KB
testcase_08 AC 126 ms
55,828 KB
testcase_09 AC 127 ms
55,780 KB
testcase_10 AC 127 ms
55,960 KB
testcase_11 AC 127 ms
55,732 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 126 ms
55,968 KB
testcase_15 AC 126 ms
56,108 KB
testcase_16 AC 127 ms
56,072 KB
testcase_17 WA -
testcase_18 AC 130 ms
56,040 KB
testcase_19 AC 128 ms
56,044 KB
testcase_20 AC 128 ms
55,844 KB
testcase_21 AC 127 ms
56,180 KB
testcase_22 AC 128 ms
56,052 KB
testcase_23 AC 692 ms
55,912 KB
testcase_24 WA -
testcase_25 AC 600 ms
55,860 KB
testcase_26 AC 127 ms
55,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No_103 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		int d = sc.nextInt();
		int count = 0;
		if (x + y < d) {
			System.out.println(count);
			return;
		}
		int dis = d - y;
		for (int i = 0; i <= x; i++) {
			if (dis <= i)
				count += 1;
		}
		System.out.println(count);
	}
}
0