結果

問題 No.131 マンハッタン距離
ユーザー 👑 KazunKazun
提出日時 2020-08-31 14:30:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 164 bytes
コンパイル時間 225 ms
コンパイル使用メモリ 81,904 KB
実行使用メモリ 53,836 KB
最終ジャッジ日時 2024-04-27 18:23:07
合計ジャッジ時間 2,310 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,996 KB
testcase_01 AC 41 ms
52,708 KB
testcase_02 AC 38 ms
52,620 KB
testcase_03 AC 38 ms
52,432 KB
testcase_04 AC 40 ms
52,668 KB
testcase_05 AC 37 ms
52,676 KB
testcase_06 AC 37 ms
53,232 KB
testcase_07 AC 36 ms
52,428 KB
testcase_08 AC 39 ms
52,528 KB
testcase_09 AC 38 ms
53,836 KB
testcase_10 AC 37 ms
52,820 KB
testcase_11 AC 37 ms
52,236 KB
testcase_12 AC 38 ms
52,072 KB
testcase_13 AC 38 ms
52,488 KB
testcase_14 AC 39 ms
52,892 KB
testcase_15 AC 38 ms
52,444 KB
testcase_16 AC 38 ms
52,352 KB
testcase_17 AC 37 ms
52,976 KB
testcase_18 AC 37 ms
53,252 KB
testcase_19 AC 38 ms
53,176 KB
testcase_20 AC 38 ms
52,744 KB
testcase_21 AC 38 ms
53,564 KB
testcase_22 AC 37 ms
52,076 KB
testcase_23 AC 38 ms
52,360 KB
testcase_24 AC 39 ms
51,700 KB
testcase_25 AC 38 ms
52,496 KB
testcase_26 AC 38 ms
52,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X,Y,D=map(int,input().split())

P,Q=min(X,Y),max(X,Y)

if 0<=D<=P:
    print(D+1)
elif P<=D<=Q:
    print(P+1)
elif Q<=D<=P+Q:
    print(P+Q-D+1)
else:
    print(0)
0