結果
| 問題 |
No.2110 012 Matching
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-28 22:36:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 167 ms / 2,000 ms |
| コード長 | 478 bytes |
| コンパイル時間 | 1,301 ms |
| コンパイル使用メモリ | 167,844 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 01:48:30 |
| 合計ジャッジ時間 | 3,567 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
ソースコード
#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;
}