結果

問題 No.610 区間賞(Section Award)
ユーザー YosukeKawada
提出日時 2018-01-15 10:19:41
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 46,464 KB
最終ジャッジ日時 2024-12-24 02:33:38
合計ジャッジ時間 13,326 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 42 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:8: warning: assigned but unused variable - ans
Syntax OK

ソースコード

diff #

N = $stdin.gets.chomp.to_i
S = $stdin.gets.chomp.split(" ").map{ |a| a.to_i }
T = $stdin.gets.chomp.split(" ").map{ |a| a.to_i }

runner = Hash[T.map.with_index{ |n,i| [n, { t: i+1 }] }]

preliminary_head = N+1
ans = []

S.reverse.each{ |n|
  if runner[n][:t] < preliminary_head
    runner[n][:ok] = true
  end
  preliminary_head = [preliminary_head, runner[n][:t]].min
}

puts (1...N).select{ |n| runner[n][:ok] }

0