結果

問題 No.709 優勝可能性
ユーザー letrangerjpletrangerjp
提出日時 2018-06-29 22:51:50
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 350 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 11,324 KB
実行使用メモリ 114,940 KB
最終ジャッジ日時 2023-09-13 15:31:12
合計ジャッジ時間 6,606 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
19,508 KB
testcase_01 AC 80 ms
15,336 KB
testcase_02 AC 77 ms
15,256 KB
testcase_03 AC 76 ms
15,160 KB
testcase_04 AC 77 ms
15,084 KB
testcase_05 AC 77 ms
15,076 KB
testcase_06 AC 77 ms
15,124 KB
testcase_07 AC 77 ms
15,328 KB
testcase_08 AC 78 ms
15,128 KB
testcase_09 AC 77 ms
15,368 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, M = gets.split.map &:to_i
R = $<.map{|s| s.split.map &:to_i }

maximum = M.times.map{ [0, [-1]]}

R.each_with_index{|r, i|
  maximum = maximum.zip(r).map{|(max, idxs), x|
    case x <=> max
    when 1
      [x, [i]]
    when -1
      [max, idxs]
    else
      [max, idxs+[i]]
    end
  }
  p maximum.flat_map{|max, idxs|
    idxs
  }.uniq.size
}
0