Skip to content

Instantly share code, notes, and snippets.

@whatalnk whatalnk/abc124-b.rb
Created Apr 14, 2019

Embed
What would you like to do?
AtCoder ABC #124 B - Great Ocean View
n = gets.chomp.to_i
h = gets.chomp.split(" ").map(&:to_i)
h = [0] + h
ret = 0
n.times do |i|
if h[0..i].map{|x| x <= h[i+1]}.all?
ret += 1
end
end
puts ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.