結果
問題 |
No.131 マンハッタン距離
|
ユーザー |
|
提出日時 | 2015-01-21 17:34:42 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2,532 ms / 5,000 ms |
コード長 | 296 bytes |
コンパイル時間 | 433 ms |
コンパイル使用メモリ | 59,448 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-22 23:31:19 |
合計ジャッジ時間 | 15,517 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <utility> using namespace std; int main() { int x, y, d; cin >> x >> y >> d; int ans = 0; for (int i = 0; i <= d; i++) { if (d - i <= x && i <= y) { ans++; } } cout << ans << endl; return 0; }