結果

問題 No.709 優勝可能性
ユーザー letrangerjpletrangerjp
提出日時 2018-06-30 01:22:08
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,684 ms / 3,500 ms
コード長 270 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 11,556 KB
実行使用メモリ 61,840 KB
最終ジャッジ日時 2023-09-13 16:03:30
合計ジャッジ時間 16,906 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,168 KB
testcase_01 AC 78 ms
15,120 KB
testcase_02 AC 77 ms
15,132 KB
testcase_03 AC 77 ms
14,980 KB
testcase_04 AC 77 ms
15,128 KB
testcase_05 AC 77 ms
15,260 KB
testcase_06 AC 77 ms
15,248 KB
testcase_07 AC 77 ms
15,024 KB
testcase_08 AC 77 ms
15,104 KB
testcase_09 AC 77 ms
15,156 KB
testcase_10 AC 743 ms
24,812 KB
testcase_11 AC 593 ms
25,280 KB
testcase_12 AC 1,255 ms
41,608 KB
testcase_13 AC 1,640 ms
56,456 KB
testcase_14 AC 1,594 ms
56,900 KB
testcase_15 AC 1,587 ms
56,908 KB
testcase_16 AC 1,655 ms
57,552 KB
testcase_17 AC 1,684 ms
61,840 KB
testcase_18 AC 77 ms
15,056 KB
testcase_19 AC 77 ms
15,044 KB
testcase_20 AC 1,626 ms
56,468 KB
testcase_21 AC 1,641 ms
56,452 KB
testcase_22 AC 78 ms
15,116 KB
testcase_23 AC 79 ms
15,236 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

(N,M),*R=$<.map{|s|s.split.map &:to_i}
m=M.times.map{[0,[]]}
c=[i=a=0]*N
R.map{|r|
  m=m.zip(r).map{|(d, s), x|
    if x > d
      s.map{|j|
        (c[j]-=1)<1&&a-=1
      }
      d=x
      s=[]
    end
    x<d||(c[i]+=1;s<<i)
    [d,s]
  }
  p a += c[i]>0?1:0
  i+=1
}
0