結果

問題 No.131 マンハッタン距離
ユーザー rlangevinrlangevin
提出日時 2023-01-22 11:34:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 5,000 ms
コード長 196 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 86,588 KB
実行使用メモリ 71,248 KB
最終ジャッジ日時 2023-09-06 22:12:59
合計ジャッジ時間 3,424 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
70,844 KB
testcase_01 AC 66 ms
71,140 KB
testcase_02 AC 67 ms
71,156 KB
testcase_03 AC 67 ms
71,032 KB
testcase_04 AC 65 ms
71,144 KB
testcase_05 AC 70 ms
71,204 KB
testcase_06 AC 68 ms
71,100 KB
testcase_07 AC 66 ms
71,028 KB
testcase_08 AC 66 ms
71,156 KB
testcase_09 AC 67 ms
71,168 KB
testcase_10 AC 68 ms
71,096 KB
testcase_11 AC 67 ms
71,140 KB
testcase_12 AC 67 ms
71,112 KB
testcase_13 AC 66 ms
70,960 KB
testcase_14 AC 66 ms
71,068 KB
testcase_15 AC 67 ms
71,112 KB
testcase_16 AC 65 ms
70,976 KB
testcase_17 AC 67 ms
71,168 KB
testcase_18 AC 67 ms
71,204 KB
testcase_19 AC 67 ms
71,248 KB
testcase_20 AC 67 ms
70,840 KB
testcase_21 AC 70 ms
70,956 KB
testcase_22 AC 67 ms
71,168 KB
testcase_23 AC 67 ms
71,104 KB
testcase_24 AC 68 ms
71,076 KB
testcase_25 AC 67 ms
71,068 KB
testcase_26 AC 66 ms
71,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x, y, d = map(int, input().split())
if x < y:
    x, y = y, x

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