ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Kovrov IT > задача:


50507 - Sequential Numbers

Гость
• Вопросы к жюри (1)

Задачи сборника

• 50853 - Parking Place
• 50496 - Falling Bricks
• 50802 - Comparing Exams
• 50785 - Swimming Contest
• 50866 - Buy the cheapest
• 50517 - Confusion Matrix
• 50515 - Lines - Revisited
• 50999 - Overlapping Trips
• 50507 - Sequential Numbers
• 50449 - The biggest result
• 50442 - Polynomial Addition
• 50434 - Row Min Subtraction
• 50870 - ZScore normalization
• 50869 - Birthday Celebration
• 50821 - Derivative of an array
• 50513 - Climbing Up the Stairs
• 50854 - Area of Triangle Revised

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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