結果

問題 No.149 碁石の移動
ユーザー naimonon77
提出日時 2015-10-04 10:13:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 657 bytes
コンパイル時間 778 ms
コンパイル使用メモリ 65,716 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 03:13:15
合計ジャッジ時間 1,434 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <cstdio>
using namespace std;

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始! */
/* 入力終了! */

int main()
{
   int i,j;
   int Aw,Ab,Bw,Bb;
   int c,d;
   cin >> Aw >> Ab;
   cin >> Bw >> Bb;
   cin >> c >> d;
   if(c > Ab) {
      Aw -= c - Ab; Bw += c - Ab;
   }
   if(Bw < d) Aw += Bw;
   else Aw += d;
   cout << Aw << endl;
   return 0;
}

0