結果

問題 No.2110 012 Matching
ユーザー daiotadaiota
提出日時 2022-10-28 22:36:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 1,840 ms
コンパイル使用メモリ 163,620 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 05:43:02
合計ジャッジ時間 4,102 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 50 ms
4,380 KB
testcase_02 AC 127 ms
4,380 KB
testcase_03 AC 84 ms
4,376 KB
testcase_04 AC 167 ms
4,376 KB
testcase_05 AC 119 ms
4,376 KB
testcase_06 AC 114 ms
4,376 KB
testcase_07 AC 190 ms
4,380 KB
testcase_08 AC 8 ms
4,380 KB
testcase_09 AC 29 ms
4,376 KB
testcase_10 AC 189 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
typedef long long ll;
typedef pair<int,int> P;

int main(void){
	int i;

	cin.tie(0);  ios_base::sync_with_stdio(false);

	int T;
	cin >> T;
	REP(tc,T){

		ll A,B,C;
		cin >> A >> B >> C;

		ll ans=0;
		if(C>=A){
			ans+=2*A;
			C-=A;
			A=0;
			ans+=C/2;
		}else{
			ans+=2*C;
			A-=C;
			C=0;
		}

		ans+=(B/2)*2;
		B=B%2;
		if(A!=0) ans+=B;

		cout << ans << endl;


	}

	return 0;
}
0