Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created April 14, 2019 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/d5e89139696064c4ef6c3959c5804be4 to your computer and use it in GitHub Desktop.
Save whatalnk/d5e89139696064c4ef6c3959c5804be4 to your computer and use it in GitHub Desktop.
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