Please help

jaa

Joined
Jul 19, 2022
Messages
4
Reaction score
0
The first series of scores in the high jump competition has just been completed. Each of
the contestants jumped one at a time. After each jump, the scoreboard in the stadium displayed an updated list of competitors, arranged in descending order of jump height. Of several contestants with the same result, the one who reached that result earlier is ranked better.

How many contestants topped the table during the first series, even temporarily?

Input
The first line of the standard input contains a number
n, the number of contestants (1≤n≤100). The next n group of two rows contains data on the jump of one competitor. In the first of those two lines is the competitor's name (without spaces), and in the second the height of her jump, an unmarked whole number, no greater than 200.

Output
Print only one integer to the standard output, the required number of contestants who at some point (or at the end of the series) were in the first place of the results table.

Example 1
Entrance
4
Aby
115
Caroline
115
Nina
121
John
117
Output
2
Explanation
The list was led by only Aby and Nina, so two contestants.
 
Joined
May 11, 2022
Messages
60
Reaction score
6
Python:
this seems like a homework problem. but ok
players = int(input("how many players? "))
count = 0
best = 0
for i in range(0,players):
   name =input("player name? ")
   distance =int(input("how far was her/his hump? "))
   if distance > best:
      best = distance
      count += 1
print(count)
 

jaa

Joined
Jul 19, 2022
Messages
4
Reaction score
0
Python:
this seems like a homework problem. but ok
players = int(input("how many players? "))
count = 0
best = 0
for i in range(0,players):
   name =input("player name? ")
   distance =int(input("how far was her/his hump? "))
   if distance > best:
      best = distance
      count += 1
print(count)
THANK YOU SOOOO MUCH!!! could you please look at my new thread and solve it, pleaseee?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top