Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 26
Sorry for fail to get pro.
We have same problem because Google play was unable to update in that period of time 😔😒😒
And we were late for coaching 😭😫😫
+ 8
I've now only tested 2 cases.
But works as expected.
What do you think goes wrong?
+ 6
No, that's Not the point. I've tested this, and is ok for All cases
import math
me = input()
agends = int(input())
others = input().split()
if agends > 5:
agends = 5
waiting = others.copy()
waiting.append(me)
waiting.sort()
pos = 1 + waiting.index(me)
time = (math.ceil(pos/agends))*20
print(time)
+ 6
https://code.sololearn.com/c4972WE54JWy/?ref=app
This is my code for that question. I hope this may help you.
+ 5
For this discussion, I've added this two lines.:
If agends > 5
agends = 5
It Passes all Tests.
Normaly it works w/o this boths lines.
+ 4
~ swim ~
in any competitive programming challenges, all the inputs tested are always valid.
so you don't need to handle them to avoid errors.
let's say a question only has integer inputs, the test input will never turn into a string and test whether the program can handle strings or not. if they don't clearly state it, then you don't have to do exception handling at all.
that is what my past experience in competitive programming are like
+ 3
n = str(input()) #name
a = int(input()) #number of agents available
w = str(input()) #waiters list
w = w.split(" ")
w.append(n)#add to list
w = sorted(w)#sort the list
q = (w.index(n)) #find index of the name
t =((q//a)*20)+20#find time
print(t)
My code passed all the test cases
+ 2
Ok, you mean it fails at the SL test cases?
+ 2
Do you speak Ukrainian and Russian?
+ 1
Baccano 76
I don't know to whom your question is directed to?
I do not speak Ukrainian and Russian.
Okay...
+ 1
I hope this will make you understand
https://code.sololearn.com/cdqFQUYBTEzh/?ref=app
0
https://code.sololearn.com/ccSoXVaanxT1/?ref=app
0
anyone here?
0
import math as ma
name=input()
agent=int(input())
other=input().split()
s=list(other)
s.append(name)
s.sort()
m=s
if(agent>5):
agent=5
count=0
for i in m:
count+=1
if(i==name):
res=ma.ceil((count/agent))*20
print(res)
It pass all the test case if you run this code in python language
Try This
0
This code is so bad, if we have more than 5 people in queue. You didn't use any algorithm there. Your bad...
0
Ashwin why did you put ( q//a ) to find time?
0
My solution:
https://code.sololearn.com/cYOvJxYH3kQr/?ref=app
0
My answer to the challenge is :
lines = ""
for i in range(3):
lines += input()+";"
agents = []
agents = lines.split(";")
nb = int(agents[1])
# Les nols de drivers mis dans une liste file
moi = agents[0]
file = list(agents[2].split(" "))
file.append(agents[0])
file_rang= sorted(file)
mon_rang = file_rang.index(moi)+1
reponse = mon_rang//nb*20
if mon_rang%nb >= 1 :
reponse += 20
print(int(reponse))
Un
0
import math
x=input()
y=int(input())
z=input().split()
z.append(x)
z.sort()
time=20
n=1
#n =no. of agents base case
for i in z:
if i in x:
ind=z.index(i)+1
print(time*n)
else:
n= math.ceil(len(z)/y)
Can somebody tell me whats wrong with this code only test 4 is not getting cleared rest are ok