結果

問題 No.709 優勝可能性
ユーザー letrangerjpletrangerjp
提出日時 2018-06-29 23:01:51
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 376 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 11,468 KB
実行使用メモリ 108,304 KB
最終ジャッジ日時 2023-09-13 15:33:39
合計ジャッジ時間 6,876 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,180 KB
testcase_01 AC 80 ms
15,008 KB
testcase_02 AC 81 ms
15,124 KB
testcase_03 AC 78 ms
15,264 KB
testcase_04 AC 79 ms
15,004 KB
testcase_05 AC 79 ms
15,044 KB
testcase_06 AC 79 ms
15,204 KB
testcase_07 AC 77 ms
15,080 KB
testcase_08 AC 80 ms
15,228 KB
testcase_09 AC 81 ms
15,132 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, 0]}

R.each_with_index{|r, i|
  maximum = maximum.zip(r).map{|(max, idxs), x|
    flg = 1<<i
    case x <=> max
    when 1
      [x, flg]
    when -1
      [max, idxs]
    else
      [max, idxs|flg]
    end
  }
  p maximum.map{|max, idxs|
    idxs
  }.inject(:|).to_s(2).count(?1)
}
0