結果
| 問題 |
No.131 マンハッタン距離
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-12 05:37:08 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 301 bytes |
| コンパイル時間 | 839 ms |
| コンパイル使用メモリ | 65,660 KB |
| 最終ジャッジ日時 | 2025-01-09 17:38:21 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <iostream>
void solve() {
int x, y, d;
std::cin >> x >> y >> d;
std::cout << std::max(0, d + 1 - std::max(d - x, 0) - std::max(d - y, 0))
<< std::endl;
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}