結果
| 問題 | No.131 マンハッタン距離 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-08-06 00:01:14 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 136 ms / 5,000 ms | 
| コード長 | 411 bytes | 
| コンパイル時間 | 3,359 ms | 
| コンパイル使用メモリ | 74,344 KB | 
| 実行使用メモリ | 41,464 KB | 
| 最終ジャッジ日時 | 2024-07-18 03:34:17 | 
| 合計ジャッジ時間 | 7,800 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 | 
ソースコード
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);return;}
        System.out.println(count);
    }
}
            
            
            
        