Created
April 14, 2019 03:04
-
-
Save whatalnk/d5e89139696064c4ef6c3959c5804be4 to your computer and use it in GitHub Desktop.
AtCoder ABC #124 B - Great Ocean View
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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