結果

問題 No.2110 012 Matching
ユーザー hourenhouren
提出日時 2022-10-28 21:51:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 759 bytes
コンパイル時間 1,963 ms
コンパイル使用メモリ 165,360 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 04:44:54
合計ジャッジ時間 3,642 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define fix(x) fixed << setprecision(x)
#define asc(x) x, vector<x>, greater<x>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool chmax(T&a, const T&b){if(a<b){a=b;return 1;}return 0;}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t;
    cin >> t;
    rep(houren,t){
        ll a,b,c,x;
        cin >> a >> b >> c;
        x = min(a,c);
        a -= x, c -= x;
        ll ans = (x+b/2)*2;
        b &= 1;
        if(a && b) ans++;
        if(c) ans += c/2;
        cout << ans << '\n';
    }
    return 0;
}
0