Problem 158A - Next Round (Python3 Solution)
Разница между en1 и en2, 693 символ(ов) изменены
InFor this problem, most of the solution was used by lambda.↵

I have no idea why lambda? ↵

You can easily use regular normal python syntax and data structures.↵

My solution with python is as follows:↵

```↵
participents_count, position = map(int, input().split(' '))↵
total_advanced = 0↵

scores = list(map(int, input().split(' ')))↵

total_advanced = 0↵
for point in scores:↵
    if point >= scores[position-1] and point != 0:↵
        total_advanced += 1↵

print(total_advanced)↵

```↵

- First I'm taking user input of number_of_participents, the position that will be compared to calculate advances. splitting the inputs through space and converting them into integrates using map().↵
- Next, I'm collecting scores that have been gained by the participants by splitting the inputs through space and converting them into integrates using map().↵
- Next iterating over the scores of the participants.↵
- if the score is greater than or equal to the mentioned position participant's score and not less than zero then increase 1 for advancing participant's count.↵


N.B. 
The complex part tofor me was understanding the second integer of the first line. Actually, it was telling about the position of the participeant's input to be calculated.↵

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский faahad.hossain 2023-01-24 22:53:47 693
en1 Английский faahad.hossain 2023-01-24 22:43:17 648 Initial revision (published)