結果
| 問題 |
No.149 碁石の移動
|
| コンテスト | |
| ユーザー |
ajiruajiru
|
| 提出日時 | 2020-02-11 06:19:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 363 bytes |
| コンパイル時間 | 504 ms |
| コンパイル使用メモリ | 63,212 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-01 07:13:55 |
| 合計ジャッジ時間 | 1,111 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
ソースコード
#include <iostream>
using namespace std;
int main(void) {
int aw, ab, bw, bb, c, d;
cin >> aw >> ab >> bw >> bb >> c >> d;
//move only black stones as many as possible
int first = min(ab, c);
c -= first;
int second = min(aw, c);
aw -= second;
bw += second;
//move only white stones
int third = min(bw, d);
aw += third;
cout << aw << endl;
return 0;
}
ajiruajiru