結果

問題 No.2110 012 Matching
ユーザー ぷらぷら
提出日時 2022-10-28 23:28:31
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 327 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 2,211 ms
コンパイル使用メモリ 200,992 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 02:44:45
合計ジャッジ時間 5,505 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while(t--) {
        long long a,b,c;
        cin >> a >> b >> c;
        long long ans = 0;
        long long d = min(a,c);
        ans += d*2;
        a -= d;
        c -= d;
        ans += b/2*2;
        ans += c/2;
        if(b%2 && a) {
            ans++;
        }
        cout << ans << endl;
    }
}
0