結果
問題 | No.131 マンハッタン距離 |
ユーザー |
![]() |
提出日時 | 2019-08-22 22:04:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 357 bytes |
コンパイル時間 | 1,417 ms |
コンパイル使用メモリ | 165,540 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 02:11:55 |
合計ジャッジ時間 | 2,348 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include "bits/stdc++.h"using namespace std;typedef long long ll;void Say(bool say, string a = "Yes", string b = "No"){cout << (say ? a : b) << endl;};int main(){ll x, y, d;cin >> x >> y >> d;if(x + y < d){cout << 0 << endl;return 0;}cout << d + 1 - max(d - x, 0LL) - max(d - y, 0LL) << endl;return 0;}