結果
| 問題 |
No.2110 012 Matching
|
| コンテスト | |
| ユーザー |
nyya
|
| 提出日時 | 2022-12-17 16:46:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 341 ms / 2,000 ms |
| コード長 | 928 bytes |
| コンパイル時間 | 3,906 ms |
| コンパイル使用メモリ | 228,920 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-17 01:48:49 |
| 合計ジャッジ時間 | 8,237 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i=0;i<(n);i++)
#define per(i,n) for(int i=(n)-1;i>=0;i--)
#define all(x) x.begin(),x.end()
typedef long long ll;
//using mint = modint;
using mint = modint998244353;
//using mint = modint1000000007;
using P = pair<int, int>;
const ll INF=1LL<<60, dx[]={0,1,0,-1},dy[]={1,0,-1,0};
template <typename T> inline bool chmin(T& a,const T&b) {if(a>b){a=b; return 1;} return 0;}
template <typename T> inline bool chmax(T& a,const T&b) {if(a<b){a=b; return 1;} return 0;}
ll solve() {
ll a,b,c;
cin >> a >> b >> c;
ll ans=0;
ll ac=min(a,c);
ll b2=b/2;
ans+=ac*2;
a-=ac;
c-=ac;
ans+=b2*2;
b-=(b2*2);
if(a>0) ans+=b;
else ans+=(c/2);
return ans;
}
int main(){
int t;
cin >> t;
while(t--) {
cout << solve() << endl;;
}
return 0;
}
nyya