結果
問題 | No.149 碁石の移動 |
ユーザー | siguma323 |
提出日時 | 2016-05-23 09:20:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 613 bytes |
コンパイル時間 | 810 ms |
コンパイル使用メモリ | 94,300 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 03:16:56 |
合計ジャッジ時間 | 1,326 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <vector> #include <string> #include <algorithm> #include <numeric> #include <iostream> #include <cstdlib> #include <cstring> #include <cmath> #include <utility> #include <list> #include <functional> #include <queue> #include <map> #include <iterator> #include <iomanip> #include <complex> using namespace std; using ull = unsigned long long; using ll = long long; int main() { int aw,ab; int bw,bb; int c,d; cin >> aw >> ab >> bw >> bb >> c >> d; if(ab >= c) { aw += min(bw,d); } else { bw += min(aw,c-ab); aw -= c-ab; aw += min(bw,d); } cout << aw << endl; }