結果
| 問題 | No.131 マンハッタン距離 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-01-21 17:43:35 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| + 437µs | |
| コード長 | 284 bytes |
| 記録 | |
| コンパイル時間 | 278 ms |
| コンパイル使用メモリ | 69,376 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-27 11:16:25 |
| 合計ジャッジ時間 | 2,014 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
int x, y, d;
cin >> x >> y >> d;
int ans;
if (x + y < d) {
ans = 0;
} else {
ans = d + 1;
if (x < d) {
ans -= d - x;
}
if (y < d) {
ans -= d - y;
}
}
cout << ans << endl;
return 0;
}