結果

問題 No.2110 012 Matching
ユーザー CleyLCleyL
提出日時 2022-11-07 13:17:46
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 305 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 68,352 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-28 02:47:20
合計ジャッジ時間 4,905 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 78 ms
4,380 KB
testcase_02 AC 203 ms
4,376 KB
testcase_03 AC 134 ms
4,380 KB
testcase_04 AC 267 ms
4,380 KB
testcase_05 AC 190 ms
4,376 KB
testcase_06 AC 189 ms
4,376 KB
testcase_07 AC 305 ms
4,376 KB
testcase_08 AC 11 ms
4,380 KB
testcase_09 AC 45 ms
4,376 KB
testcase_10 AC 304 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
void solve(){
  long long a,b,c;cin>>a>>b>>c;
  long long ans = b/2*2;
  b%=2;
  if(a<c){
    ans += a*2;
    c-=a;
    a = 0;
  }else{
    ans += c*2;
    a-=c;
    c = 0;
  }
  if(a && b){
    ans++;
    a--;b--;
  }
  ans += c/2;
  cout << ans << endl;
}

int main(){
  int n;cin>>n;
  for(int i = 0; n > i; i++)solve();
}
0