結果
問題 | No.149 碁石の移動 |
ユーザー |
![]() |
提出日時 | 2015-02-12 23:31:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 2,420 bytes |
コンパイル時間 | 2,547 ms |
コンパイル使用メモリ | 157,924 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 02:45:10 |
合計ジャッジ時間 | 2,027 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS//#define _GLIBCXX_DEBUG#include <bits/stdc++.h>using namespace std;typedef long long ll;typedef vector<int> vi;typedef vector<vi> vvi;typedef pair<int,int> pii;#define all(c) (c).begin(), (c).end()#define loop(i,a,b) for(ll i=a; i<ll(b); i++)#define rep(i,b) loop(i,0,b)#define pb push_back#define eb emplace_back#define mp make_pair#define mt make_tupletemplate<class T> istream & operator>>(istream & is, vector<T> &);template<class T> ostream & operator<<(ostream & os, vector<T> const &);template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple<T...> const &){}template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple<T...> const & t){ os << (n==0?"":" ") << get<n>(t); _ot<n+1>(os, t); }template<class...T> ostream & operator<<(ostream & os, tuple<T...> const & t){ _ot<0>(os, t); return os; }template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _it(istream &, tuple<T...> &){}template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _it(istream & is, tuple<T...> & t){ is >> get<n>(t); _it<n+1>(is, t); }template<class...T> istream & operator>>(istream & is, tuple<T...> & t){ _it<0>(is, t); return is; }template<class T, class U> istream & operator<<(istream & is, pair<T,U> & p){ return is >> p.first >> p.second; }template<class T, class U> ostream & operator<<(ostream & os, pair<T,U> const & p){ return os << "(" << p.first << ", " << p.second << ") "; }template<class T> istream & operator>>(istream & is, vector<T> & v){ rep(i,v.size()) is >> v[i]; return is; }template<class T> ostream & operator<<(ostream & os, vector<T> const & v){ rep(i,v.size()) os << v[i] << (i+1==(int)v.size()?"":" "); return os; }#ifdef DEBUG#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<mt(__VA_ARGS__)<<" ["<<__LINE__<<"]"<<endl)#else#define dump(...)#endifint main(){int a1,a2,b1,b2,c1,c2;while(cin>>a1>>a2>>b1>>b2>>c1>>c2){rep(i,c1){if(a2){a2--;b2++;} else {a1--;b1++;}}dump(a1,a2);dump(b1,b2);rep(i,c2){if(b1){b1--;a1++;} else {b2--;a2++;}}cout << a1 << endl;}}