結果
問題 |
No.709 優勝可能性
|
ユーザー |
|
提出日時 | 2018-06-30 00:43:57 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 483 bytes |
コンパイル時間 | 43 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 123,840 KB |
最終ジャッジ日時 | 2024-07-01 00:38:29 |
合計ジャッジ時間 | 18,679 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 1 WA * 15 TLE * 2 -- * 4 |
コンパイルメッセージ
Syntax OK
ソースコード
N, M = gets.split.map &:to_i R = $<.map{|s| s.split.map &:to_i } maximum = M.times.map{ [0, []]} counts = [0] * N ans = 0 R.each_with_index{|r, i| maximum = maximum.zip(r).map{|(max, idxs), x| case x <=> max when 1 idxs.each{|j| counts[j] -= 1 ans -= 1 if counts[j] < 1 } counts[i] += 1 ans += 1 [x, [i]] when -1 [max, idxs] else counts[i] += 1 ans += 1 [max, idxs + [i]] end } p ans }