結果
| 問題 |
No.131 マンハッタン距離
|
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2020-09-16 15:49:15 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 244 bytes |
| コンパイル時間 | 498 ms |
| コンパイル使用メモリ | 66,308 KB |
| 最終ジャッジ日時 | 2025-01-14 15:14:20 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 19 WA * 5 |
ソースコード
#include <iostream>
using namespace std;
int main(){
int x, y, d;
cin >> x >> y >> d;
if (d <= min(x, y)){
cout << d + 1 << endl;
} else if (d <= max(x, y)){
cout << min(x, y) + 1 << endl;
} else {
cout << x + y + 1 - d << endl;
}
}
SSRS