結果
| 問題 | No.2110 012 Matching | 
| コンテスト | |
| ユーザー |  kpinkcat | 
| 提出日時 | 2023-09-23 23:46:30 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 937 bytes | 
| コンパイル時間 | 1,653 ms | 
| コンパイル使用メモリ | 191,980 KB | 
| 最終ジャッジ日時 | 2025-02-17 01:50:10 | 
| ジャッジサーバーID (参考情報) | judge5 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 1 WA * 10 | 
ソースコード
#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;
int main()
{
    ll t, a, b, c;
    cin >> t;
    for (int i = 0; i < t; i++){
        ll max1 = 0;
        cin >> a >> b >> c;
        if (a && c){
            ll tmp = min(a, c);
            max1 += tmp*2;
            if (a >= c){
                a -= c;
                c = 0;
            } else {
                c -= a;
                a = 0;
            }
        }
        if (b%2){
            max1 += (b-1);
            b = 1;
        }
        else max1 += b;
        if (a && b){
            max1++;
            a--;
            b = 0;
        }
        if (c && c%2){
            max1 += (c - 1)/2;
            c = 1;
        }
        else if (c) max1 += c/2;
        cout << max1 << "\n";
    }
}
            
            
            
        