結果

問題 No.2110 012 Matching
ユーザー ntuda
提出日時 2025-02-11 19:42:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 322 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 695 ms
コンパイル使用メモリ 82,120 KB
実行使用メモリ 77,376 KB
最終ジャッジ日時 2025-02-11 19:42:23
合計ジャッジ時間 5,697 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    a,b,c = map(int,input().split())
    ans = 0
    x = min(a,c)
    ans += 2 * x
    a -= x
    c -= x

    x = b // 2
    ans += x * 2
    b -= x * 2

    x = min(a,b)
    ans += x
    a -= x
    b -= x

    x = c // 2
    ans += x
    c -= 2 * x

    print(ans)
0