fork download
  1. # your code goes here
  2. n,my_score,p = map(int,input().split())
  3. if n == 0:
  4. print(1)
  5. else:
  6. scores = list(map(int,input().split()))
  7. cnt = 1
  8. flag = True
  9. for score in scores:
  10. if score == my_score and len(scores) < p:
  11. print(cnt)
  12. flag = False
  13. break
  14. if score < my_score : #and len(scores) < p 제거함.
  15. print(cnt)
  16. flag = False
  17. break
  18. cnt += 1
  19. if flag:
  20. if score > my_score and len(scores) < p:
  21. print(cnt)
  22. else:
  23. print(-1)
Success #stdin #stdout 0.03s 9800KB
stdin
5 3 3
10 10 3 3 1
stdout
5