結果

問題 No.2110 012 Matching
ユーザー kpinkcatkpinkcat
提出日時 2023-09-23 23:35:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 762 bytes
コンパイル時間 1,754 ms
コンパイル使用メモリ 197,048 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-23 23:35:21
合計ジャッジ時間 5,001 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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);
        else max1 += b;
        if (c && c%2) max1 += (c - 1);
        else if (c) max1 += c;
        cout << max1 << "\n";
    }
}
0