HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN112 Homeworks 2013-2015 > problem:


15-SprPrE1-70. 50507 - Sequential Numbers

CEN112 Homeworks 2013-2015

Start: Dec.15.2013 at 12:00:00 PM
Finish: Dec.15.2013 at 05:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 15-SprHW-30. 50788 - Eight Puzzle
• 15-SprHW-40. 50746 - Most Visited
• 15-SprHW-60. 50516 - Lines
• 15-SprPr2-20. 50509 - Reading Book
• 15-SprPr2-60. 50766 - Word Puzzle
• 15-SprPr2-80. 50786 - Top Question
• 15-SprPrE1-20. 50785 - Swimming ...
• 15-SprPrE1-40. 50748 - Gold Store
• 15-SprPrE1-70. 50507 - Sequen...
• 15-SprResit-20. 50447 - Swimming ...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Sequential Numbers

Your chemistry professor needs to process a series of numbers for her research. She needs to count the number of numbers which are greater than its previous and smaller than its next.

Question: Write a program that is going to read a number series. Then, your program will count and print the number of numbers which are greater than its previous and smaller than its next.

Input specification
You will be given an integer (n) the number of numbers where 0 ≤ n ≤ 3000. Then in the following n lines you will have n numbers where each number is between 1 and 10e8.

Output specification
Show just one number: the number of numbers which comply the given criteria.

Sample Input I
8
4
5
6
6
9
2
3
7
Sample Output I
2

Explanation:

  • 4 is the first number, so it doesn't have a number before
  • 6 is greater than 5 but not less than 6
  • 9 is greater than 6 but not less than 2
  • 2 is not greater than 9
  • 7 is the last number, so it doesn't have a number next
There are only two numbers 5 and 3.



Для отправки решений необходимо выполнить вход.

www.contester.ru