#C6205. Tournament Sorted Check

    ID: 49940 Type: Default 1000ms 256MiB

Tournament Sorted Check

Tournament Sorted Check

In this problem, you are given a list of teams along with their scores in a tournament. Your task is to determine if the list is sorted in non-increasing (i.e., descending) order based on the scores. An empty list or a list with a single team is considered sorted. Formally, if there are (n) teams with scores (s_1, s_2, \dots, s_n), then the list is sorted if and only if (s_i \geq s_{i+1}) for all (1 \leq i < n).

inputFormat

The first line contains an integer (n) ((0 \leq n \leq 10^5)), representing the number of teams. Each of the next (n) lines contains a team name (a string without spaces) and an integer score, separated by a single space.

outputFormat

Print True if the scores are in non-increasing order, otherwise print False.## sample

3
TeamA 3
TeamB 2
TeamC 1
True