結果

問題 No.3434 [Cherry 8th Tune N] 大きくして Hold on Card!
コンテスト
ユーザー tkykwtnb
提出日時 2026-01-23 22:22:30
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 972 ms / 2,000 ms
+ 179µs
コード長 425 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 593 ms
コンパイル使用メモリ 64,432 KB
実行使用メモリ 104,820 KB
最終ジャッジ日時 2026-11-01 01:44:25
合計ジャッジ時間 50,291 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

T=int(input())
for _ in range(T):
    N=int(input())
    A=list(map(int,input().split()))
    B=list(map(int,input().split()))
    mx=now=sum(A)
    mxi=-1
    A=list(sorted([[A[i],i] for i in range(N)]))
    for i in range(N):
        nxt=now-A[i][0]+B[i]
        if nxt>mx:
            mx=nxt
            mxi=i
        now=nxt
    ans=0
    for i in range(mxi+1):
        ans+=1<<(N-1-A[i][1])
    print(bin(1<<N|ans)[3:])
0