結果
問題 |
No.2110 012 Matching
|
ユーザー |
|
提出日時 | 2022-10-29 11:33:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 319 ms / 2,000 ms |
コード長 | 793 bytes |
コンパイル時間 | 695 ms |
コンパイル使用メモリ | 82,052 KB |
実行使用メモリ | 76,388 KB |
最終ジャッジ日時 | 2024-07-06 11:21:20 |
合計ジャッジ時間 | 3,847 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
#!/usr/bin/python # -*- coding: utf-8 -*- # import from sys import stdin, setrecursionlimit setrecursionlimit(10**8) def int_map(): return map(int,input().split()) def int_list(): return list(map(int,input().split())) def int_mtx(N): x = [list(map(int, stdin.readline().split())) for _ in range(N)] return x def str_mtx(N): x = [list(stdin.readline()[:-1]) for _ in range(N)] return x def print_space(l): return print(" ".join([str(x) for x in l])) """ main code """ T = int(input()) for _ in range(T): a,b,c = int_map() ans = 0 ans += 2*(b//2) b = b%2 m = min(a,c) ans += 2*m a -= m c -= m if a == 0: ans += c//2 print(ans) elif a > 0: ans += min(a,b) print(ans)