結果

問題 No.131 マンハッタン距離
ユーザー tsunatama5tsunatama5
提出日時 2015-02-04 23:52:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 537 bytes
コンパイル時間 4,030 ms
コンパイル使用メモリ 73,120 KB
実行使用メモリ 57,952 KB
最終ジャッジ日時 2023-09-05 11:58:04
合計ジャッジ時間 9,894 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,736 KB
testcase_01 WA -
testcase_02 AC 121 ms
55,508 KB
testcase_03 AC 119 ms
55,972 KB
testcase_04 AC 120 ms
55,904 KB
testcase_05 AC 120 ms
55,636 KB
testcase_06 AC 120 ms
55,944 KB
testcase_07 WA -
testcase_08 AC 123 ms
55,840 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 124 ms
55,688 KB
testcase_13 WA -
testcase_14 AC 119 ms
55,732 KB
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 AC 967 ms
55,704 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 120 ms
55,456 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;
		
		if (d >= (x1+y1)) {
		} else {
			for (x=d;x>=(d-y1);x--) {
				if ((d-x)>=0 && y1>=(d-x)) {
					ans++;
				}
			}
		}
		System.out.println(ans);		
	}
}
0