[codeforces] A. Next Round알고리즘(Python,Java)2019. 8. 21. 19:12
Table of Contents
반응형
problem
"Contestant who earns a score equal to or greater than the k-th place finisher's score will advance to the next round, as long as the contestant earns a positive score..." — an excerpt from contest rules.
A total of n participants took part in the contest (n ≥ k), and you already know their scores. Calculate how many participants will advance to the next round.
using language : python3
N,K = map(int,input().split())
Seperated_num = list(map(int,input().split()))
Num = Seperated_num[K-1]
count = 0
for loop in Seperated_num:
if loop >= Num and loop>0:
count +=1
print(count)
반응형
'알고리즘(Python,Java)' 카테고리의 다른 글
[codeforces] A. Team (0) | 2019.08.22 |
---|---|
[codeforces] A. String Task (0) | 2019.08.21 |
[Codeforces]A. Way Too Long Words (0) | 2019.08.18 |
[codeforces] A. Theatre Square (0) | 2019.08.15 |
[Codeforeces] A. Watermelon (0) | 2019.08.15 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상