結果
| 問題 |
No.2110 012 Matching
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-28 22:38:17 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 389 ms / 2,000 ms |
| コード長 | 590 bytes |
| コンパイル時間 | 868 ms |
| コンパイル使用メモリ | 86,276 KB |
| 最終ジャッジ日時 | 2025-02-08 14:46:33 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
ソースコード
#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <map>
using namespace std;
int main(){
int t;cin >> t;
while(t--){
long long a,b,c;
cin >> a >> b >> c;
long long ans = 0;
ans += (b/2)*2;
if(b%2==0) b = 0;
else b = 1;
if(a<=c){
ans += a*2;
c -= a;
a = 0;
ans += (c/2);
}else if(c<a){
ans += c*2;
a -= c;
c = 0;
if(b==1 && 1<=a) ans++;
}
cout << ans << endl;
}
}