結果

問題 No.2110 012 Matching
ユーザー hiro71687khiro71687k
提出日時 2023-08-01 18:42:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 324 ms / 2,000 ms
コード長 624 bytes
コンパイル時間 4,714 ms
コンパイル使用メモリ 253,184 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 17:52:46
合計ジャッジ時間 7,785 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 79 ms
5,376 KB
testcase_02 AC 205 ms
5,376 KB
testcase_03 AC 137 ms
5,376 KB
testcase_04 AC 280 ms
5,376 KB
testcase_05 AC 204 ms
5,376 KB
testcase_06 AC 183 ms
5,376 KB
testcase_07 AC 316 ms
5,376 KB
testcase_08 AC 12 ms
5,376 KB
testcase_09 AC 48 ms
5,376 KB
testcase_10 AC 324 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using namespace std;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll mod=1000000007;
ll inf=1000;
int main(){
    ll t;
    cin >> t;
    for (ll i = 0; i < t; i++)
    {
        ll a,b,c;
        cin >> a >> b >> c;
        ll x=0;
        x+=min(c,a)*2;
        a-=x/2;
        c-=x/2;
        x+=c/2;
        if (b%2)
        {
            if (a>=1)
            {
                x+=b;
            }else{
                x+=b-1;
            }
        }else{
            x+=b;
        }
        cout << x << endl;
    }
    
}
0