結果

問題 No.2110 012 Matching
ユーザー nephrologistnephrologist
提出日時 2022-10-28 22:17:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 355 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 77,952 KB
最終ジャッジ日時 2023-09-20 05:18:48
合計ジャッジ時間 3,347 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,468 KB
testcase_01 AC 120 ms
77,804 KB
testcase_02 AC 138 ms
77,752 KB
testcase_03 AC 130 ms
77,844 KB
testcase_04 AC 152 ms
77,844 KB
testcase_05 AC 136 ms
77,756 KB
testcase_06 AC 135 ms
77,796 KB
testcase_07 AC 157 ms
77,952 KB
testcase_08 AC 109 ms
77,720 KB
testcase_09 AC 116 ms
77,896 KB
testcase_10 AC 160 ms
77,708 KB
testcase_11 AC 75 ms
71,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.buffer.readline

t = int(input())

for i in range(t):
    a, b, c = map(int, input().split())
    res = 0
    res += 2 * (b // 2)
    b %= 2
    res += 2 * min(a, c)
    a, c = a - min(a, c), c - min(a, c)
    if a == 0:
        res += c // 2
        c %= 2
    elif c == 0:
        if b:
            res += b
    print(res)
0