It's failing one hidden test case, what's wrong? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
4th Oct 2020, 3:33 AM
RuntimeERROR
RuntimeERROR - avatar
6 Answers
+ 2
Was that really so long??? 🙄🤔 x = input() y = int(input()) z = sorted(input().split() + [x]) print((z.index(x)//y+1)*20)
4th Oct 2020, 5:07 AM
Namit Jain
Namit Jain - avatar
+ 1
Remove elif x>a: print(40) from the cases
4th Oct 2020, 3:50 AM
Ruba Kh
Ruba Kh - avatar
+ 1
Satnam was just a beginner, so the code was not as compact, just trying some ideas!
4th Oct 2020, 7:50 AM
RuntimeERROR
RuntimeERROR - avatar
+ 1
Netha_r2071 Ook np 😅👍 Tell me if it works 🙂👍
4th Oct 2020, 5:04 PM
Namit Jain
Namit Jain - avatar
0
Ruba Kh it's required for agents ==1: And it's not required for all other cases right? Anyways thanks :)
4th Oct 2020, 4:02 AM
RuntimeERROR
RuntimeERROR - avatar
0
Namit Jain I liked your way of thinking, This is mine yourName = input() agentNum = int(input()) otherNames = input().split(' ') otherNames.append(yourName) otherNames.sort() fullTime = 0 for x in range(0,5,agentNum): if otherNames[x] == yourName: fullTime = fullTime + 20 break elif otherNames[x] > yourName: break else: fullTime = fullTime + 20 print(int(fullTime))
4th Oct 2020, 5:08 PM
Ruba Kh
Ruba Kh - avatar