結果

問題 No.131 マンハッタン距離
ユーザー カニ戯(ryカニ戯(ry
提出日時 2015-02-24 16:51:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 232 bytes
コンパイル時間 2,210 ms
コンパイル使用メモリ 71,792 KB
実行使用メモリ 56,164 KB
最終ジャッジ日時 2023-09-06 03:57:03
合計ジャッジ時間 7,190 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
55,300 KB
testcase_01 AC 133 ms
56,164 KB
testcase_02 AC 131 ms
55,676 KB
testcase_03 AC 129 ms
55,948 KB
testcase_04 AC 133 ms
55,860 KB
testcase_05 AC 131 ms
53,936 KB
testcase_06 AC 128 ms
53,952 KB
testcase_07 AC 140 ms
55,688 KB
testcase_08 AC 130 ms
56,152 KB
testcase_09 AC 138 ms
55,688 KB
testcase_10 AC 138 ms
55,568 KB
testcase_11 AC 136 ms
55,720 KB
testcase_12 AC 130 ms
54,024 KB
testcase_13 AC 134 ms
55,828 KB
testcase_14 AC 131 ms
55,532 KB
testcase_15 AC 133 ms
55,728 KB
testcase_16 AC 140 ms
55,536 KB
testcase_17 AC 132 ms
55,676 KB
testcase_18 AC 136 ms
55,828 KB
testcase_19 AC 131 ms
55,812 KB
testcase_20 AC 132 ms
55,572 KB
testcase_21 AC 135 ms
55,796 KB
testcase_22 AC 131 ms
55,720 KB
testcase_23 AC 135 ms
55,532 KB
testcase_24 AC 136 ms
55,532 KB
testcase_25 AC 136 ms
55,796 KB
testcase_26 AC 137 ms
55,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] a) {
		Scanner s = new Scanner(System.in);
		int x=s.nextInt(),y=s.nextInt(),d=s.nextInt();
		System.out.println(d>x+y?0:(x>d?d:x)-(y>d?0:d-y)+1);
	}
}
0