結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,988 KB
testcase_01 WA -
testcase_02 AC 121 ms
55,776 KB
testcase_03 AC 131 ms
55,448 KB
testcase_04 AC 123 ms
55,764 KB
testcase_05 AC 120 ms
55,808 KB
testcase_06 AC 118 ms
55,896 KB
testcase_07 AC 120 ms
55,924 KB
testcase_08 AC 120 ms
55,564 KB
testcase_09 AC 123 ms
55,556 KB
testcase_10 AC 126 ms
55,736 KB
testcase_11 AC 122 ms
55,564 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 121 ms
55,564 KB
testcase_15 AC 124 ms
55,708 KB
testcase_16 AC 122 ms
56,064 KB
testcase_17 WA -
testcase_18 AC 127 ms
55,664 KB
testcase_19 AC 121 ms
55,928 KB
testcase_20 AC 119 ms
55,524 KB
testcase_21 AC 120 ms
55,864 KB
testcase_22 AC 134 ms
55,796 KB
testcase_23 AC 873 ms
55,784 KB
testcase_24 WA -
testcase_25 AC 859 ms
55,972 KB
testcase_26 AC 121 ms
55,508 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