結果

問題 No.2110 012 Matching
ユーザー noshi91noshi91
提出日時 2022-10-28 23:33:57
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 332 ms / 2,000 ms
コード長 545 bytes
コンパイル時間 756 ms
コンパイル使用メモリ 75,948 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 06:51:28
合計ジャッジ時間 4,147 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 84 ms
4,380 KB
testcase_02 AC 218 ms
4,376 KB
testcase_03 AC 146 ms
4,380 KB
testcase_04 AC 291 ms
4,376 KB
testcase_05 AC 205 ms
4,380 KB
testcase_06 AC 197 ms
4,376 KB
testcase_07 AC 329 ms
4,376 KB
testcase_08 AC 13 ms
4,380 KB
testcase_09 AC 48 ms
4,380 KB
testcase_10 AC 332 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/modint>

using mint = atcoder::modint998244353;
using ll = long long;

#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>

int main() {

  int T;
  std::cin >> T;
  for (int cc = 0; cc < T; cc++) {
    ll A, B, C;
    std::cin >> A >> B >> C;
    ll ans = 0;
    {
      ll m = std::min(A, C);
      ans += 2 * m;
      A -= m;
      C -= m;
    }
    if (A == 0) {
      ans += 2 * (B / 2);
      ans += C / 2;
    }
    else {
      ans += B;
    }
    std::cout << ans << "\n";
  }

  return 0;
}
0