結果

問題 No.131 マンハッタン距離
ユーザー nbisco
提出日時 2017-01-24 23:53:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-23 08:05:25
合計ジャッジ時間 1,647 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

x, y, d = map(int, input().split(" "))

count = 0
if x <= d and y >= d:
    count = x + 1
elif x >= d and y < d:
    count = y + 1
else: # x < d and y < d
    if x + y >= d:
        if d == 0:
            count = 1
        else:
            count = x + y - d + 1
    else:
        count = 0
print(count)
0