結果
| 問題 | No.131 マンハッタン距離 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-08-05 23:55:01 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 342 bytes | 
| コンパイル時間 | 3,432 ms | 
| コンパイル使用メモリ | 73,896 KB | 
| 実行使用メモリ | 41,488 KB | 
| 最終ジャッジ日時 | 2024-07-18 03:33:22 | 
| 合計ジャッジ時間 | 8,005 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| other | AC * 19 WA * 5 | 
ソースコード
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);
	}
}
            
            
            
        