結果

問題 No.504 ゲーム大会(ランキング)
ユーザー wotsushiwotsushi
提出日時 2017-04-23 16:24:01
言語 Ruby
(3.3.0)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 11,264 KB
実行使用メモリ 17,416 KB
最終ジャッジ日時 2023-09-29 12:30:19
合計ジャッジ時間 4,055 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
15,324 KB
testcase_01 AC 69 ms
15,016 KB
testcase_02 AC 69 ms
15,168 KB
testcase_03 AC 71 ms
15,124 KB
testcase_04 AC 70 ms
15,088 KB
testcase_05 AC 71 ms
15,112 KB
testcase_06 AC 66 ms
15,112 KB
testcase_07 AC 198 ms
17,344 KB
testcase_08 AC 198 ms
17,272 KB
testcase_09 AC 200 ms
17,232 KB
testcase_10 AC 197 ms
17,292 KB
testcase_11 AC 194 ms
17,280 KB
testcase_12 AC 197 ms
17,412 KB
testcase_13 AC 188 ms
17,416 KB
testcase_14 AC 203 ms
17,168 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
a = (1..N).map {gets.to_i}
ans = a[1..-1].inject([1]) {|memo, x|
  memo.push(
    if x > a[0]
      memo[-1] + 1
    else
      memo[-1]
    end
  )
}
puts ans
0