結果

問題 No.131 マンハッタン距離
ユーザー 👑 colognecologne
提出日時 2022-03-02 17:01:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 5,000 ms
コード長 294 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 71,308 KB
最終ジャッジ日時 2023-09-23 09:23:56
合計ジャッジ時間 3,702 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,260 KB
testcase_01 AC 67 ms
71,036 KB
testcase_02 AC 72 ms
71,304 KB
testcase_03 AC 69 ms
70,792 KB
testcase_04 AC 66 ms
71,052 KB
testcase_05 AC 69 ms
71,060 KB
testcase_06 AC 65 ms
71,216 KB
testcase_07 AC 70 ms
71,116 KB
testcase_08 AC 69 ms
71,056 KB
testcase_09 AC 69 ms
70,880 KB
testcase_10 AC 68 ms
70,964 KB
testcase_11 AC 65 ms
71,088 KB
testcase_12 AC 69 ms
71,024 KB
testcase_13 AC 68 ms
71,088 KB
testcase_14 AC 67 ms
71,204 KB
testcase_15 AC 68 ms
71,052 KB
testcase_16 AC 71 ms
71,116 KB
testcase_17 AC 71 ms
71,052 KB
testcase_18 AC 70 ms
71,080 KB
testcase_19 AC 69 ms
71,180 KB
testcase_20 AC 70 ms
70,964 KB
testcase_21 AC 67 ms
71,236 KB
testcase_22 AC 69 ms
71,308 KB
testcase_23 AC 69 ms
71,244 KB
testcase_24 AC 68 ms
71,068 KB
testcase_25 AC 67 ms
71,068 KB
testcase_26 AC 70 ms
70,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    x, y, d = map(int, input().split())

    if d <= min(x, y):
        print(d + 1)
    elif min(x, y) <= d <= max(x, y):
        print(min(x, y) + 1)
    elif max(x, y) <= d <= x + y:
        print(x + y - d + 1)
    else:
        print(0)


if __name__ == '__main__':
    main()
0