結果

問題 No.2110 012 Matching
ユーザー ぷらぷら
提出日時 2022-10-28 23:28:31
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 334 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 2,431 ms
コンパイル使用メモリ 198,316 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 06:45:45
合計ジャッジ時間 6,337 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 84 ms
4,380 KB
testcase_02 AC 216 ms
4,380 KB
testcase_03 AC 143 ms
4,376 KB
testcase_04 AC 288 ms
4,376 KB
testcase_05 AC 202 ms
4,380 KB
testcase_06 AC 196 ms
4,380 KB
testcase_07 AC 327 ms
4,376 KB
testcase_08 AC 12 ms
4,376 KB
testcase_09 AC 49 ms
4,376 KB
testcase_10 AC 334 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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