#CCBCHBAHAI0000012. Breaking the Records (Breaking the Records)
Breaking the Records (Breaking the Records)
Breaking the Records
Source: HackerRank
Version: Phuoc Hung OJ Extended
Problem
Given scores . The first score establishes both initial records. Count how many later scores are strictly greater than all previous scores and how many are strictly smaller than all previous scores.
Input
Line 1 contains . Line 2 contains .
Output
Print the number of high-record breaks followed by the number of low-record breaks.
Subtasks
Subtask 1 (20 points): ; .
Subtask 2 (30 points): ; .
Subtask 3 (50 points): ; .
Example
Input
9
10 5 20 20 4 5 2 25 1
Output
2 4
Explanation
The values follow directly from the definitions and illustrate the valid index range of the array scan.