結果
問題 | No.149 碁石の移動 |
ユーザー |
![]() |
提出日時 | 2016-10-07 22:37:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 558 bytes |
コンパイル時間 | 542 ms |
コンパイル使用メモリ | 71,792 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-24 03:20:59 |
合計ジャッジ時間 | 1,157 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include<iostream> #include<algorithm> #include<cstdio> #include<cstdlib> #include<vector> #include<map> #include<queue> #include<string> #include<sstream> #include<cmath> using namespace std; int main(){ int aw, ab, bw, bb, c, d; cin >> aw >> ab >> bw >> bb >> c >> d; if( ab < c ){ aw -= (c - ab); bb += ab; bw += (c - ab); ab = 0; }else{ ab -= c; bb += c; } if( bw < d ){ bb -= (d - bw); aw += bw; ab += (d - bw); bw = 0; }else{ bw -= d; aw += d; } cout << aw << endl; return 0; }