+ 8
New driver's license
name = input() agent = int(input()) client = list(input().split()) time = 20 client.append(name) client.sort() for z in client[::agent]: if name in z: print(time) break else: time += 20 What's wrong?
12 Respuestas
+ 17
name = input()
agent = int(input())
client = list(input().split())
client.append(name)
client.sort()
print(int(client.index(name)//agent)*20 + 20)
+ 6
🤦 Thanx
+ 1
name = input()
agent = int(input())
client = list(input().split())
client.append(name)
client.sort()
print(int(client.index(name)//agent)*20 + 20)
Mind explaining why you divided by 20 and added 20?
+ 1
me = input()
num = int(input())
all = input().split()
all.append(me)
all.sort()
x = 0
for i in all:
if i != me:
x += 1
else:
print(((x//num)+1)*20)
break
Easy one
+ 1
I can't pass the third test case what's wrong?
name = input()
agents = int(input())
others = input()
div = others.split(" ")
div.append(name)
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
order = []
for i in range(len(div)):
if div[i][0] in alp:
order.append(div[i])
#print(order)
for i in range(len(order)):
for j in range(i+1):
if order[i] < order[j]:
order[i],order[j] = order[j],order[i]
in_line = order.index(name) + 1
#print(in_line)
time = 20
total = time * in_line
if agents == 2:
total = total -20
elif agents == 3:
total = total - 40
elif agents == 4:
total = total - 60
print(total)
+ 1
name = input()
agents = int(input()
clients = input().split(" ")
count = 0
for i in clients:
if i < clients:
count += 1
print((count//agents)*20+20)
0
Try this
0
Einstein IJ because indexing starts from 0
0
https://code.sololearn.com/cfZICcElYP82/?ref=app
This is my begginer solution what do you think of it ?
0
myname = input()
num_agents = int(input())
other_names = list(input().split())
other_names.append(myname)
other_names.sort()
ind_myname = other_names.index(myname)+1
print('20' if ind_myname <=num_agents else (ind_myname-num_agents)*20+20)
0
if op==1 or op==0:
print(int((20)))
else:
print(int(op*20))