結果

問題 No.131 マンハッタン距離
ユーザー uafr_csuafr_cs
提出日時 2015-05-15 12:55:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 377 bytes
コンパイル時間 2,333 ms
コンパイル使用メモリ 72,072 KB
実行使用メモリ 56,064 KB
最終ジャッジ日時 2023-09-20 08:05:48
合計ジャッジ時間 7,112 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,688 KB
testcase_01 AC 125 ms
55,976 KB
testcase_02 AC 125 ms
55,760 KB
testcase_03 AC 125 ms
55,760 KB
testcase_04 AC 127 ms
55,784 KB
testcase_05 AC 130 ms
55,508 KB
testcase_06 AC 128 ms
55,740 KB
testcase_07 AC 127 ms
55,996 KB
testcase_08 AC 126 ms
56,060 KB
testcase_09 AC 126 ms
55,844 KB
testcase_10 AC 129 ms
55,712 KB
testcase_11 AC 128 ms
55,884 KB
testcase_12 AC 128 ms
55,748 KB
testcase_13 AC 129 ms
55,836 KB
testcase_14 AC 127 ms
55,496 KB
testcase_15 AC 127 ms
55,768 KB
testcase_16 AC 128 ms
55,872 KB
testcase_17 AC 128 ms
56,064 KB
testcase_18 AC 125 ms
55,776 KB
testcase_19 AC 129 ms
55,684 KB
testcase_20 AC 127 ms
55,724 KB
testcase_21 AC 131 ms
54,024 KB
testcase_22 AC 127 ms
55,780 KB
testcase_23 AC 128 ms
55,568 KB
testcase_24 AC 128 ms
55,676 KB
testcase_25 AC 129 ms
55,944 KB
testcase_26 AC 130 ms
55,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		final long x = sc.nextLong();
		final long y = sc.nextLong();
		final long d = sc.nextLong();
		
		System.out.println(Math.max(0, (d + 1) - Math.max(0, d - x) - Math.max(0, d - y)));
	}
	
}
0