結果
問題 | 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); endN, M = ascanparams = nildegree = [0]*Ndegree[0] = Mcount = 1N.times do |i|player = ascanif !paramsparams = player.map{|e| [e,[i]]}elseM.times do |j|if params[j][0] < player[j]params[j][1].each do |id|count -= 1 if (degree[id] -= 1) == 0endparams[j] = [player[j], []]endif params[j][0] <= player[j]params[j][1] << icount += 1 if (degree[i] += 1) == 1endendendp countend