結果

問題 No.131 マンハッタン距離
ユーザー soujikisoujiki
提出日時 2015-06-23 21:46:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 5,021 ms
コンパイル使用メモリ 72,768 KB
実行使用メモリ 56,036 KB
最終ジャッジ日時 2023-09-22 00:17:35
合計ジャッジ時間 7,772 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,732 KB
testcase_01 AC 116 ms
55,912 KB
testcase_02 AC 117 ms
55,784 KB
testcase_03 AC 117 ms
55,736 KB
testcase_04 AC 116 ms
55,848 KB
testcase_05 AC 120 ms
55,696 KB
testcase_06 AC 125 ms
55,676 KB
testcase_07 AC 117 ms
55,492 KB
testcase_08 AC 115 ms
55,992 KB
testcase_09 AC 113 ms
56,036 KB
testcase_10 AC 119 ms
55,700 KB
testcase_11 AC 114 ms
55,740 KB
testcase_12 AC 116 ms
55,748 KB
testcase_13 AC 122 ms
55,676 KB
testcase_14 AC 114 ms
55,892 KB
testcase_15 AC 113 ms
55,688 KB
testcase_16 AC 114 ms
55,500 KB
testcase_17 AC 114 ms
55,768 KB
testcase_18 AC 113 ms
55,932 KB
testcase_19 AC 114 ms
55,692 KB
testcase_20 AC 120 ms
55,684 KB
testcase_21 AC 114 ms
55,732 KB
testcase_22 AC 114 ms
55,968 KB
testcase_23 AC 114 ms
55,448 KB
testcase_24 AC 115 ms
56,004 KB
testcase_25 AC 115 ms
55,940 KB
testcase_26 AC 114 ms
55,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.awt.geom.*;
import static java.util.Arrays.*;

class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int x = Integer.parseInt(stdIn.next());
		int y = Integer.parseInt(stdIn.next());
		int d = Integer.parseInt(stdIn.next());
		int count = d+1;
		if(x-d<0){
			count += x-d;
		}
		if(y-d<0){
			count += y-d;
		}
		if(count<0){
			count = 0;
		}
		out.println(count);
		out.flush(); 
	}
}
0