結果

問題 No.131 マンハッタン距離
ユーザー tsunatama5tsunatama5
提出日時 2015-02-04 23:26:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 208 ms / 5,000 ms
コード長 489 bytes
コンパイル時間 3,459 ms
コンパイル使用メモリ 72,328 KB
実行使用メモリ 56,212 KB
最終ジャッジ日時 2023-09-05 11:57:34
合計ジャッジ時間 8,348 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,992 KB
testcase_01 AC 122 ms
55,432 KB
testcase_02 AC 124 ms
55,512 KB
testcase_03 AC 130 ms
56,212 KB
testcase_04 AC 131 ms
55,936 KB
testcase_05 AC 131 ms
55,736 KB
testcase_06 AC 128 ms
55,676 KB
testcase_07 AC 121 ms
55,484 KB
testcase_08 AC 123 ms
55,432 KB
testcase_09 AC 126 ms
55,512 KB
testcase_10 AC 122 ms
55,724 KB
testcase_11 AC 122 ms
55,908 KB
testcase_12 AC 124 ms
55,760 KB
testcase_13 AC 123 ms
55,812 KB
testcase_14 AC 124 ms
55,812 KB
testcase_15 AC 126 ms
56,100 KB
testcase_16 AC 127 ms
55,804 KB
testcase_17 AC 126 ms
55,732 KB
testcase_18 AC 125 ms
55,472 KB
testcase_19 AC 125 ms
55,840 KB
testcase_20 AC 126 ms
55,688 KB
testcase_21 AC 125 ms
56,132 KB
testcase_22 AC 127 ms
55,700 KB
testcase_23 AC 129 ms
56,076 KB
testcase_24 AC 208 ms
54,052 KB
testcase_25 AC 129 ms
55,840 KB
testcase_26 AC 129 ms
55,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class P131 {
	public static void main(String args[]) {
		
		Scanner sc = new Scanner(System.in);
		String n = sc.nextLine();
		String[] nstrs = n.split(" ");
		int nint[] = new int[3];
		
		for (int a=0;a<3;a++) {
			nint[a] = Integer.parseInt(nstrs[a]);
		}
		
		int x1 = nint[0];
		int y1 = nint[1];
		int d = nint[2];
		int x;
		int ans = 0;
		
		for (x=x1;x>=0;x--) {
			if (d-x>=0 && y1>=(d-x)) {
				ans++;
			}
		}
		System.out.println(ans);		
	}
}
0