結果
問題 | No.149 碁石の移動 |
ユーザー |
![]() |
提出日時 | 2020-08-26 03:42:51 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 322 bytes |
コンパイル時間 | 2,259 ms |
コンパイル使用メモリ | 190,792 KB |
最終ジャッジ日時 | 2025-01-13 14:55:30 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int aw, ab, bw, bb; cin >> aw >> ab >> bw >> bb; int c, d; cin >> c >> d; int x; x = min(ab, c); ab -= x; aw -= c - x; bw += c - x; bb += c; cout << aw + min(bw, d) << '\n'; return 0; }