結果

問題 No.2110 012 Matching
ユーザー 👑 chro_96chro_96
提出日時 2022-10-28 21:35:51
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 603 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 28,360 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-20 04:24:09
合計ジャッジ時間 2,390 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 19 ms
4,500 KB
testcase_02 AC 47 ms
4,376 KB
testcase_03 AC 32 ms
4,376 KB
testcase_04 AC 63 ms
4,380 KB
testcase_05 AC 45 ms
4,376 KB
testcase_06 AC 43 ms
4,376 KB
testcase_07 AC 71 ms
4,376 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 11 ms
4,380 KB
testcase_10 AC 70 ms
4,380 KB
testcase_11 AC 0 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main () {
  int t = 0;
  
  int res = 0;
  
  res = scanf("%d", &t);
  
  while (t > 0) {
    long long a = 0LL;
    long long b = 0LL;
    long long c = 0LL;
    long long ans = 0LL;
    res = scanf("%lld", &a);
    res = scanf("%lld", &b);
    res = scanf("%lld", &c);
    ans = (b/2LL)*2LL;
    b %= 2LL;
    if (a < c) {
      ans += 2LL*a;
      c -= a;
      a = 0LL;
      ans += c/2LL;
    } else {
      ans += 2LL*c;
      a -= c;
      c = 0LL;
      if (a > 0LL && b > 0LL) {
        ans += 1LL;
      }
    }
    printf("%lld\n", ans);
    t--;
  }
  
  return 0;
}
0