結果
| 問題 | No.131 マンハッタン距離 |
| コンテスト | |
| ユーザー |
nbisco
|
| 提出日時 | 2017-01-24 23:55:52 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 21 ms / 5,000 ms |
| + 552µs | |
| コード長 | 342 bytes |
| 記録 | |
| コンパイル時間 | 57 ms |
| コンパイル使用メモリ | 15,232 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-10-06 10:41:04 |
| 合計ジャッジ時間 | 2,088 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
x, y, d = map(int, input().split(" "))
count = 0
if x >= d and y >= d:
count = d + 1
elif 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)
nbisco