結果
| 問題 | No.709 優勝可能性 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-06-30 00:38:21 | 
| 言語 | Ruby (3.4.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1,087 ms / 3,500 ms | 
| コード長 | 627 bytes | 
| コンパイル時間 | 849 ms | 
| コンパイル使用メモリ | 7,424 KB | 
| 実行使用メモリ | 22,016 KB | 
| 最終ジャッジ日時 | 2024-07-01 00:37:54 | 
| 合計ジャッジ時間 | 12,923 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 22 | 
コンパイルメッセージ
Syntax OK
ソースコード
def ascan; gets.split.map(&:to_i); end
N, M = ascan
params = nil
degree = [0]*N
degree[0] = M
count = 1
N.times do |i|
    player = ascan
    if !params
        params = player.map{|e| [e,[i]]}
    else
        M.times do |j|
            if params[j][0] < player[j]
                params[j][1].each do |id|
                    count -= 1 if (degree[id] -= 1) == 0
                end
                params[j] = [player[j], []]
            end
            if params[j][0] <= player[j]
                params[j][1] << i
                count += 1 if (degree[i] += 1) == 1
            end
        end
    end
    p count
end
            
            
            
        