結果
問題 | No.149 碁石の移動 |
ユーザー |
|
提出日時 | 2016-04-04 15:50:26 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 583 bytes |
コンパイル時間 | 963 ms |
コンパイル使用メモリ | 54,776 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 03:16:20 |
合計ジャッジ時間 | 1,067 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <iostream> #include <utility> using namespace std; int main() { pair<int, int> a, b; cin >> a.first >> a.second; cin >> b.first >> b.second; int c, d; cin >> c >> d; if (a.second >= c) { if (d <= b.first) { a.first += d; } else { a.first += b.first; } } else { a.first -= (c - a.second); b.first += (c - a.second); if (d <= b.first) { a.first += d; } else { a.first += b.first; } } cout << a.first << endl; return 0; }