Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 😭😫😫
23rd Dec 2019, 6:17 PM
Mehdi Eslami
Mehdi Eslami - avatar
+ 8
I've now only tested 2 cases. But works as expected. What do you think goes wrong?
22nd Dec 2019, 10:55 AM
Coding Cat
Coding Cat - avatar
+ 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)
22nd Dec 2019, 11:30 AM
Coding Cat
Coding Cat - avatar
+ 6
https://code.sololearn.com/c4972WE54JWy/?ref=app This is my code for that question. I hope this may help you.
3rd Jan 2020, 9:51 AM
Puthur Harthik
+ 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.
22nd Dec 2019, 11:38 AM
Coding Cat
Coding Cat - avatar
+ 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
23rd Dec 2019, 2:56 AM
Shen Bapiro
Shen Bapiro - avatar
+ 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
6th Feb 2020, 6:30 PM
Ashwin
Ashwin - avatar
+ 2
Ok, you mean it fails at the SL test cases?
22nd Dec 2019, 11:00 AM
Coding Cat
Coding Cat - avatar
+ 2
Do you speak Ukrainian and Russian?
23rd Dec 2019, 6:33 PM
Baccano 76
Baccano 76 - avatar
15th Aug 2020, 3:44 PM
Arjun VK
Arjun VK - avatar
+ 1
Baccano 76 I don't know to whom your question is directed to? I do not speak Ukrainian and Russian. Okay...
23rd Dec 2019, 6:43 PM
Baccano 76
Baccano 76 - avatar
+ 1
I hope this will make you understand https://code.sololearn.com/cdqFQUYBTEzh/?ref=app
18th Dec 2021, 5:27 PM
PythonCoder🐍
0
https://code.sololearn.com/ccSoXVaanxT1/?ref=app
23rd Dec 2019, 6:56 PM
Witold Hodur
Witold Hodur - avatar
0
anyone here?
23rd Dec 2019, 9:08 PM
alex tom
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
24th Jan 2020, 5:50 PM
Aman Srivastav
Aman Srivastav - avatar
0
This code is so bad, if we have more than 5 people in queue. You didn't use any algorithm there. Your bad...
5th May 2020, 8:52 PM
Ярослав Радченко
Ярослав Радченко - avatar
0
Ashwin why did you put ( q//a ) to find time?
14th Mar 2021, 7:14 PM
nivedha srinivasan
nivedha srinivasan - avatar
23rd Sep 2021, 6:08 PM
_] | [\]
_] | [\] - avatar
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
29th Oct 2021, 3:37 PM
rayhan chetouia
rayhan chetouia - avatar
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
20th Dec 2021, 5:27 PM
Waqas Ahmad
Waqas Ahmad - avatar