結果

問題 No.2110 012 Matching
ユーザー harurunharurun
提出日時 2022-10-28 21:38:50
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 1,478 bytes
コンパイル時間 4,852 ms
コンパイル使用メモリ 185,004 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 04:28:53
合計ジャッジ時間 7,022 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 82 ms
4,376 KB
testcase_02 AC 218 ms
4,376 KB
testcase_03 AC 143 ms
4,376 KB
testcase_04 AC 282 ms
4,376 KB
testcase_05 AC 201 ms
4,376 KB
testcase_06 AC 194 ms
4,376 KB
testcase_07 AC 321 ms
4,376 KB
testcase_08 AC 12 ms
4,376 KB
testcase_09 AC 48 ms
4,380 KB
testcase_10 AC 325 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <queue>
#include <string>
#include <iomanip>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <utility>
#include <stack>
#include <random>
#include <complex>
#include <functional>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <assert.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using namespace std;
using ll=long long;
#define read(x) cin>>(x);
#define readll(x) ll (x);cin>>(x);
#define readS(x) string (x);cin>>(x);
#define readvll(x,N) vector<ll> (x)((N));for(int i=0;i<(N);i++){cin>>(x)[i];}
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define rep2d(i,j,H,W) for(ll (i)=0;(i)<(H);(i)++)for(ll (j)=0;(j)<(W);j++)
#define is_in(x,y) (0<=(x) && (x)<H && 0<=(y) && (y)<W)
#define yn {cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
#define double_out(x) fixed << setprecision(x)
template<class T> inline void erase_duplicate(vector<T>& A){sort(A.begin(),A.end());A.erase(unique(A.begin(),A.end()),A.end());}
inline ll powll(ll x,ll n){ll r=1;while(n>0){if(n&1){r*=x;};x*=x;n>>=1;};return r;}

void solve(){
  ll A,B,C;
  cin>>A>>B>>C;
  ll ans=0;
  ans+=B/2*2;
  B%=2;
  ll D=min(A,C);
  A-=D;
  C-=D;
  ans+=2*D;
  ans+=C/2;
  C%=2;
  ll E=min(A,B);
  A-=E;
  B-=E;
  ans+=E;
  cout<<ans<<endl;
}

int main(){
  ll T;
  cin>>T;
  for(ll i=0;i<T;i++){
    solve();
  }
}

0