結果

問題 No.131 マンハッタン距離
ユーザー hhgfhn1hhgfhn1
提出日時 2018-11-21 21:10:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,629 ms / 5,000 ms
コード長 372 bytes
コンパイル時間 2,201 ms
コンパイル使用メモリ 71,344 KB
実行使用メモリ 56,548 KB
最終ジャッジ日時 2023-08-26 02:41:01
合計ジャッジ時間 12,882 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,804 KB
testcase_01 AC 121 ms
55,612 KB
testcase_02 AC 122 ms
56,064 KB
testcase_03 AC 343 ms
55,712 KB
testcase_04 AC 290 ms
55,824 KB
testcase_05 AC 252 ms
55,864 KB
testcase_06 AC 150 ms
55,908 KB
testcase_07 AC 122 ms
55,584 KB
testcase_08 AC 123 ms
56,256 KB
testcase_09 AC 123 ms
56,548 KB
testcase_10 AC 121 ms
55,860 KB
testcase_11 AC 120 ms
56,136 KB
testcase_12 AC 121 ms
56,200 KB
testcase_13 AC 121 ms
55,996 KB
testcase_14 AC 121 ms
55,908 KB
testcase_15 AC 120 ms
55,816 KB
testcase_16 AC 123 ms
55,608 KB
testcase_17 AC 121 ms
55,576 KB
testcase_18 AC 120 ms
55,884 KB
testcase_19 AC 119 ms
55,816 KB
testcase_20 AC 120 ms
56,072 KB
testcase_21 AC 121 ms
55,664 KB
testcase_22 AC 123 ms
56,112 KB
testcase_23 AC 1,629 ms
55,840 KB
testcase_24 AC 954 ms
55,600 KB
testcase_25 AC 1,628 ms
55,828 KB
testcase_26 AC 1,629 ms
55,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int x=scanner.nextInt();
		int y=scanner.nextInt();
		int d=scanner.nextInt();
		long cnt=0;
		for(int i=0;i<=x;i++) {
			int j=d-i;
			if(0<=j&&j<=y) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}
0