結果

問題 No.131 マンハッタン距離
ユーザー rf141rf141
提出日時 2015-08-05 23:55:01
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 3,212 ms
コンパイル使用メモリ 71,428 KB
実行使用メモリ 57,704 KB
最終ジャッジ日時 2023-09-25 04:03:31
合計ジャッジ時間 8,134 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,968 KB
testcase_01 AC 127 ms
55,692 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 127 ms
55,816 KB
testcase_08 AC 126 ms
55,996 KB
testcase_09 AC 125 ms
56,048 KB
testcase_10 AC 126 ms
55,660 KB
testcase_11 AC 127 ms
55,904 KB
testcase_12 AC 126 ms
55,788 KB
testcase_13 AC 127 ms
56,040 KB
testcase_14 AC 128 ms
55,692 KB
testcase_15 AC 127 ms
56,116 KB
testcase_16 AC 127 ms
55,528 KB
testcase_17 AC 126 ms
55,984 KB
testcase_18 AC 126 ms
55,748 KB
testcase_19 AC 129 ms
55,532 KB
testcase_20 AC 126 ms
55,860 KB
testcase_21 AC 125 ms
55,760 KB
testcase_22 AC 125 ms
55,744 KB
testcase_23 AC 123 ms
56,100 KB
testcase_24 AC 128 ms
56,276 KB
testcase_25 AC 127 ms
55,716 KB
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Distance{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		int y = scan.nextInt();
		int d = scan.nextInt();
		int count=d+1;
		if(x < d)count -= d - x;
		if(y < d)count -= d - y;
		if(x+y<d)System.out.println(0);
		System.out.println(count);
	}
}
0