結果
| 問題 |
No.131 マンハッタン距離
|
| コンテスト | |
| ユーザー |
mayoko_
|
| 提出日時 | 2015-01-20 23:27:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 593 bytes |
| コンパイル時間 | 710 ms |
| コンパイル使用メモリ | 72,380 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-22 23:15:04 |
| 合計ジャッジ時間 | 1,529 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 1 |
ソースコード
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#define INF 1000000000
using namespace std;
typedef long long ll;
int main(void) {
ll x, y, d;
cin >> x >> y >> d;
if (d >= y) {
if (d-y > x) {
cout << 0 << endl;
} else {
cout << x - (d-y) + 1 << endl;
}
} else {
cout << min(x, d) + 1 << endl;
}
return 0;
}
mayoko_