結果

問題 No.3173 じゃんけんの勝ちの回数
ユーザー nikoro256
提出日時 2025-06-06 21:59:08
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 532 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 82,348 KB
実行使用メモリ 79,892 KB
最終ジャッジ日時 2025-06-14 10:09:10
合計ジャッジ時間 61,911 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 31 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
T=int(input())
inf = 10**18
for _ in range(T):
    A=list(map(int, input().split()))
    B=list(map(int, input().split()))
    ans1 = min(A[0],B[1]) + min(A[1],B[2]) + min(A[2],B[0])
    ans2 = inf
    ds =  [[0,0],[1,1],[2,2],[1,0],[2,1],[0,2]]
    for d in permutations(ds):
        A_ = A[::]
        B_ = B[::]
        ans = 0
        for a,b in d:
            t =  min(A_[a], B_[b])
            A_[a] -= t
            B_[b] -= t
        ans2 = min(ans2, sum(A_))
    print(ans2,ans1)
        
0