結果

問題 No.2680 研究室配属
ユーザー tomeruntomerun
提出日時 2024-03-20 21:04:25
言語 Crystal
(1.11.2)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 12,901 ms
コンパイル使用メモリ 293,652 KB
実行使用メモリ 8,192 KB
最終ジャッジ日時 2024-03-20 21:04:40
合計ジャッジ時間 11,911 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 4 ms
6,676 KB
testcase_06 AC 4 ms
6,676 KB
testcase_07 AC 4 ms
6,676 KB
testcase_08 AC 4 ms
6,676 KB
testcase_09 AC 3 ms
6,676 KB
testcase_10 AC 13 ms
6,676 KB
testcase_11 AC 13 ms
6,676 KB
testcase_12 AC 16 ms
6,676 KB
testcase_13 AC 14 ms
6,676 KB
testcase_14 AC 18 ms
6,676 KB
testcase_15 AC 4 ms
6,676 KB
testcase_16 AC 36 ms
6,676 KB
testcase_17 AC 8 ms
6,676 KB
testcase_18 AC 23 ms
6,676 KB
testcase_19 AC 47 ms
8,064 KB
testcase_20 AC 39 ms
7,936 KB
testcase_21 AC 6 ms
6,676 KB
testcase_22 AC 29 ms
6,676 KB
testcase_23 AC 68 ms
8,192 KB
testcase_24 AC 70 ms
8,192 KB
testcase_25 AC 71 ms
8,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = read_line.split.map(&.to_i)
a = read_line.split.map(&.to_i)
ts = Array.new(n) { read_line.split.map(&.to_i) }
assign = Array.new(n, -1)
m.times do |i|
  n.times do |j|
    next if assign[j] != -1
    next if a[ts[j][i]] == 0
    a[ts[j][i]] -= 1
    assign[j] = ts[j][i]
  end
end
puts assign.join(" ")
0