結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 127 ms
55,948 KB
testcase_03 AC 239 ms
55,628 KB
testcase_04 AC 212 ms
55,956 KB
testcase_05 AC 194 ms
56,120 KB
testcase_06 AC 146 ms
56,160 KB
testcase_07 AC 128 ms
55,996 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 127 ms
56,304 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 881 ms
55,772 KB
testcase_26 AC 883 ms
56,004 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;
		}
		for (int i = 0; i <= x; i++) {
			int dis = d - i;
			if(dis <= y) count+=1;
		}
		System.out.println(count);
	}
}
0