SHARE
TWEET

Untitled

a guest Apr 24th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = gets.chomp.to_i
  2. h = gets.chomp.split(" ").map(&:to_i)
  3. h = [0] + h
  4.  
  5. ret = 0
  6. n.times do |i|
  7.   if h[0..i].map{|x| x <= h[i+1]}.all?
  8.     ret += 1
  9.   end
  10. end
  11.  
  12. puts ret
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top