結果

問題 No.2680 研究室配属
ユーザー titiatitia
提出日時 2024-03-20 21:37:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 518 ms / 2,000 ms
コード長 408 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 42,240 KB
最終ジャッジ日時 2024-03-20 21:37:17
合計ジャッジ時間 4,805 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,984 KB
testcase_01 AC 29 ms
9,984 KB
testcase_02 AC 29 ms
9,984 KB
testcase_03 AC 30 ms
9,984 KB
testcase_04 AC 30 ms
9,984 KB
testcase_05 AC 36 ms
10,112 KB
testcase_06 AC 39 ms
10,240 KB
testcase_07 AC 39 ms
10,240 KB
testcase_08 AC 37 ms
10,240 KB
testcase_09 AC 35 ms
10,112 KB
testcase_10 AC 77 ms
12,416 KB
testcase_11 AC 73 ms
11,776 KB
testcase_12 AC 91 ms
13,568 KB
testcase_13 AC 74 ms
11,264 KB
testcase_14 AC 95 ms
13,440 KB
testcase_15 AC 39 ms
10,368 KB
testcase_16 AC 185 ms
23,040 KB
testcase_17 AC 56 ms
10,880 KB
testcase_18 AC 130 ms
14,976 KB
testcase_19 AC 262 ms
27,648 KB
testcase_20 AC 195 ms
23,168 KB
testcase_21 AC 45 ms
10,496 KB
testcase_22 AC 150 ms
16,768 KB
testcase_23 AC 364 ms
42,240 KB
testcase_24 AC 394 ms
42,240 KB
testcase_25 AC 518 ms
42,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M=map(int,input().split())
A=list(map(int,input().split()))
T=[list(map(int,input().split())) for i in range(N)]

ANS=[-1]*N
L=[[] for i in range(M)]

for i in range(M):
    for j in range(N):
        if ANS[j]!=-1:
            continue
        
        x=T[j][i]

        if len(L[x])==A[x]:
            continue

        ANS[j]=x
        L[x].append(j)

print(*ANS)
0