結果

問題 No.149 碁石の移動
ユーザー testtest
提出日時 2020-09-16 15:59:10
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 355 bytes
コンパイル時間 2,954 ms
コンパイル使用メモリ 190,056 KB
最終ジャッジ日時 2025-01-14 15:14:38
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int aw, ab, bw, bb, c, d;
void input() { cin >> aw >> ab >> bw >> bb >> c >> d; }

void solve() {
  int tmp = min(ab, c);
  ab -= tmp;
  aw -= (c-tmp);
  bw += (c-tmp);
  aw += min(d, bw);
  cout << aw << endl;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  input();
  solve();
  getchar();
}
0