結果

問題 No.149 碁石の移動
ユーザー toto6114
提出日時 2019-07-29 17:32:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 565 ms
コンパイル使用メモリ 69,364 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-02 15:24:18
合計ジャッジ時間 1,270 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int a1,a2,b1,b2,c,d;
  cin >> a1 >> a2 >> b1 >> b2 >> c >> d;
  if(a2>=c) {
      a1-=0;
  }
  else {
      a1-=(c-a2);
      b1+=c-a2;
  }
  a1+=min(d,b1);
  cout << a1 << endl;
}
0