結果
問題 |
No.131 マンハッタン距離
|
ユーザー |
![]() |
提出日時 | 2015-01-27 00:20:29 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 331 bytes |
コンパイル時間 | 786 ms |
コンパイル使用メモリ | 60,508 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 03:19:02 |
合計ジャッジ時間 | 1,896 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <iostream> #include <algorithm> #include <sstream> #include <list> using namespace std; int main(int argc, char *argv[]) { int x, y, d; string s; getline(cin, s); stringstream ss(s); ss >> x >> y >> d; int sx = d - min(y, d); int ex = min(x, d); int ans = max(0, ex - sx + 1); cout << ans << endl; return 0; }