結果
問題 |
No.131 マンハッタン距離
|
ユーザー |
![]() |
提出日時 | 2025-03-20 21:12:15 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 35 ms / 5,000 ms |
コード長 | 290 bytes |
コンパイル時間 | 165 ms |
コンパイル使用メモリ | 82,352 KB |
実行使用メモリ | 53,968 KB |
最終ジャッジ日時 | 2025-03-20 21:14:12 |
合計ジャッジ時間 | 2,147 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
x, y, d = map(int, input().split()) if d < 0: print(0) elif d == 0: print(1) else: if d > x + y: print(0) else: a_min = max(0, d - y) a_max = min(x, d) if a_min > a_max: print(0) else: print(a_max - a_min + 1)