結果

問題 No.131 マンハッタン距離
ユーザー tsunabittsunabit
提出日時 2020-03-03 22:26:48
言語 Java19
(openjdk 21)
結果
AC  
実行時間 1,629 ms / 5,000 ms
コード長 390 bytes
コンパイル時間 3,314 ms
コンパイル使用メモリ 72,740 KB
実行使用メモリ 58,200 KB
最終ジャッジ日時 2023-08-04 02:09:06
合計ジャッジ時間 12,829 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,732 KB
testcase_01 AC 117 ms
56,232 KB
testcase_02 AC 120 ms
55,800 KB
testcase_03 AC 232 ms
58,200 KB
testcase_04 AC 207 ms
55,976 KB
testcase_05 AC 186 ms
56,004 KB
testcase_06 AC 135 ms
55,860 KB
testcase_07 AC 121 ms
54,000 KB
testcase_08 AC 119 ms
56,004 KB
testcase_09 AC 121 ms
55,852 KB
testcase_10 AC 124 ms
56,156 KB
testcase_11 AC 119 ms
55,728 KB
testcase_12 AC 118 ms
56,024 KB
testcase_13 AC 120 ms
56,404 KB
testcase_14 AC 118 ms
56,008 KB
testcase_15 AC 118 ms
56,032 KB
testcase_16 AC 121 ms
55,764 KB
testcase_17 AC 121 ms
56,176 KB
testcase_18 AC 120 ms
55,712 KB
testcase_19 AC 118 ms
55,844 KB
testcase_20 AC 119 ms
55,852 KB
testcase_21 AC 118 ms
53,720 KB
testcase_22 AC 121 ms
55,892 KB
testcase_23 AC 1,622 ms
55,540 KB
testcase_24 AC 1,629 ms
55,880 KB
testcase_25 AC 877 ms
55,748 KB
testcase_26 AC 874 ms
55,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No131 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt(), y = sc.nextInt(), d = sc.nextInt();
		int a = 0;
		if(d == 0) {
			System.out.println(1);
			return;
		}
		for(int i = 0; i <= x; i++) {
			if(y >= d-i && (d-i) >= 0) a++;
		}
		System.out.println(a);
	}
}
0