結果
問題 |
No.2680 研究室配属
|
ユーザー |
![]() |
提出日時 | 2024-03-20 22:14:07 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 507 bytes |
コンパイル時間 | 261 ms |
コンパイル使用メモリ | 82,388 KB |
実行使用メモリ | 183,540 KB |
最終ジャッジ日時 | 2024-09-30 08:09:30 |
合計ジャッジ時間 | 12,965 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 TLE * 2 -- * 6 |
ソースコード
import heapq N,M=map(int,input().split()) A=list(map(int,input().split())) T=[] for _ in range(N): T.append(list(map(int,input().split()))) hq=[] for i in range(N): for j in range(M): heapq.heappush(hq,(j,-T[i][j],i)) use=[False for _ in range(N)] ans=[[] for _ in range(M)] while len(hq)>0: j,t,i=heapq.heappop(hq) t=-t if not use[i] and len(ans[t])<A[t]: ans[t].append(i) use[i]=True fa=[-1]*N for i in range(M): for a in ans[i]: fa[a]=i print(*fa)