結果
| 問題 | No.131 マンハッタン距離 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-05-25 12:58:59 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 43 ms / 5,000 ms | 
| コード長 | 200 bytes | 
| コンパイル時間 | 288 ms | 
| コンパイル使用メモリ | 82,008 KB | 
| 実行使用メモリ | 52,224 KB | 
| 最終ジャッジ日時 | 2024-12-20 19:43:49 | 
| 合計ジャッジ時間 | 2,378 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 | 
ソースコード
x, y, d = map(int, input().split())
if x + y < d:
    print(0)
    exit()
if x >= d and y >= d:
    print(d + 1)
    exit()
ans = d + 1
if x < d:
    ans -= d - x
if y < d:
    ans -= d - y
print(ans)
            
            
            
        