結果

問題 No.2110 012 Matching
ユーザー butsurizuki
提出日時 2022-10-28 21:26:02
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 2,363 ms
コンパイル使用メモリ 244,448 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 00:24:03
合計ジャッジ時間 3,880 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while(t>0){
    t--;
    long long a,b,c;
    cin >> a >> b >> c;
    long long res=0;
    long long del;

    res+=(b/2)*2;
    b%=2;

    del=min(a,c);
    res+=2*del;
    a-=del;c-=del;

    del=min(a,b);
    res+=del;
    a-=del;b-=del;

    res+=(c/2);

    cout << res << "\n";
  }
  return 0;
}
0