結果

問題 No.2110 012 Matching
ユーザー 佐藤竜也佐藤竜也
提出日時 2022-12-10 15:39:38
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,897 bytes
コンパイル時間 5,331 ms
コンパイル使用メモリ 166,496 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-05 01:51:25
合計ジャッジ時間 5,958 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 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 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define rep2(i, n, s) for (int i = (n - 1); i >= (s); i--)
#define all(a)  (a).begin(),(a).end()
#define all_c(a, b) (a).begin(), (a).end(), back_inserter((b))
vector<int> dy = {-1, 0, 1, 0, -1, -1, 1, 1};
vector<int> dx = {0, 1, 0, -1, -1, 1, 1, -1};
const ll INF = numeric_limits<long long>::max();
const ll MOD = 1'000'000'007;
ll unused = INF % MOD;

ll gcd(ll A, ll B) {
    if (B == 0) return A;
    return gcd(B, A % B);
}

ll lcm(ll A, ll B) {
    ll g = gcd(A, B);
    return A / g * B;
}

// 二分検索の雛型
bool binary_search(int N, int A[], int K) {
    int left = 0, right = N - 1;
    while (left <= right) {
        int mid = (left + right) / 2;
        if (A[mid] == K) return true;
        if (A[mid] < K) left = mid + 1;
        else right = mid - 1;
    }
    return false;
}

/*
lower_bound -> if (A[mid] < K)
upper_bound -> if (A[mid] <= K)
*/
int binary_search2(int N, ll A[], ll K) {
    int left = 0, right = N;
    while (left < right) {
        int mid = (left + right) / 2;
        if (A[mid] < K) left = mid + 1;
        else right = mid;
    }
    return right;
}

/* メモ帳
・小数点以下表示 / cout << fixed << setprecision(12) << 
・ルートの計算   / sqrt(A)

・順列全列挙
    do {
        
    } while (next_permutation(V.begin() V.end()));

・bit検索
for (int i = 0; i < (1 << N); i++) {
    rep(j, 0, N) {
        int wari = (1 << j);
        if ((i / wari) % 2 == 1) {
            
        }
    }
}
*/

ll T, A, B, C, NA, NB, NC;
ll ans;

int main() {
    cin >> T;
    rep(i, 0, T) {
        cin >> A >> B >> C;
        
        ans = 2 * min(A, C) + 2 * (B / 2);
        NA = A - min(A, C), NB = B - B / 2, NC = C - min(A, C);
        ans += (min(NA, NB) + NC / 2);
        cout << ans << endl;
    }
}
0