結果
問題 |
No.2957 Combo Deck Builder
|
ユーザー |
👑 |
提出日時 | 2024-10-30 19:03:15 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 606 ms / 1,000 ms |
コード長 | 292 bytes |
コンパイル時間 | 536 ms |
コンパイル使用メモリ | 81,960 KB |
実行使用メモリ | 106,140 KB |
最終ジャッジ日時 | 2024-10-30 19:03:33 |
合計ジャッジ時間 | 18,191 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 38 |
ソースコード
R=range J=lambda:map(int,input().split()) N,*_=J() A=[[[]for i in R(N+1)]for s in R(2)] a=0 for _ in R(N): C,X,Y=J() if X<Y:a+=X;A[0][N-C]+=[X-Y] else:a+=Y;A[1][C]+=[Y-X] import heapq for t in A: s=[] for c in R(N): for x in t[c]:heapq.heappush(s,x) if s:a-=heapq.heappop(s) print(a)