結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,604 KB
testcase_01 AC 126 ms
55,540 KB
testcase_02 AC 124 ms
55,600 KB
testcase_03 AC 130 ms
55,772 KB
testcase_04 AC 128 ms
55,772 KB
testcase_05 AC 129 ms
55,824 KB
testcase_06 AC 128 ms
55,864 KB
testcase_07 AC 119 ms
55,676 KB
testcase_08 AC 123 ms
55,736 KB
testcase_09 AC 123 ms
55,468 KB
testcase_10 AC 124 ms
56,052 KB
testcase_11 AC 121 ms
55,816 KB
testcase_12 AC 120 ms
55,844 KB
testcase_13 AC 118 ms
55,820 KB
testcase_14 AC 119 ms
55,564 KB
testcase_15 AC 120 ms
55,952 KB
testcase_16 AC 121 ms
56,024 KB
testcase_17 AC 122 ms
55,980 KB
testcase_18 AC 120 ms
56,068 KB
testcase_19 AC 126 ms
56,068 KB
testcase_20 AC 125 ms
55,856 KB
testcase_21 AC 121 ms
56,036 KB
testcase_22 AC 119 ms
55,740 KB
testcase_23 AC 125 ms
55,944 KB
testcase_24 AC 208 ms
55,456 KB
testcase_25 AC 129 ms
55,812 KB
testcase_26 AC 130 ms
55,980 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