結果
問題 | No.149 碁石の移動 |
ユーザー |
![]() |
提出日時 | 2015-02-12 23:24:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 469 bytes |
コンパイル時間 | 649 ms |
コンパイル使用メモリ | 72,524 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 02:43:07 |
合計ジャッジ時間 | 1,226 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <iostream> #include <vector> #include <cstdio> #include <sstream> #include <map> #include <string> #include <algorithm> #include <queue> #include <cmath> #include <set> using namespace std; int main(){ int Aw,Ab; cin >> Aw >> Ab; int Bw,Bb; cin >> Bw >> Bb; int C,D; cin >> C >> D; int x = min(Ab, C); Bb += x; Ab -= x; Bw += C-x; Aw -= C-x; int y = min(Bw, D); Aw += y; Bw -= y; Ab += D-y; Bb -= D-y; cout << Aw << endl; return 0; }