+ 2
I made this program (new driver's license) in code coach but since 3rd case is locked I am unable to find bug please help me?
https://www.sololearn.com/coach/18?ref=app https://code.sololearn.com/ck76w61rEIUM/?ref=app
7 Antworten
+ 1
using System; namespace SoloLearn { class Program { static void Main(string[] args) { string[] inputs = new string[3] { Console.ReadLine(), Console.ReadLine(), Console.ReadLine() }; string[] names = (inputs[2] + " " + inputs[0]).Split(" "); Array.Sort(names); int index = Array.IndexOf(names, inputs[0]); index /= int.Parse(inputs[1]); index *= 20; index += 20; Console.WriteLine(index); } } }
+ 1
This is c#code for new driver's license
+ 1
I cannot say for certain whether this is the test case, but suppose one or more of the people in line before you has the same name as you. Then your code might not pass the test.
EDIT: No, the tests do not put a duplicate of your name in the queue ahead of you. I adjusted my own code so that it would fail in such case, and it passed all the tests anyway.
+ 1
Jayakrishna🇮🇳
edited bro now please check still cases are not passed
0
Mr.Pro.{Gramer}!
please explain me the problem
what is missing in my code
0
Again I say read again carefully.. If you don't understand anything then ask about that specific description.
Each agent can interview 1 person...
Ex : input A 2 B C D E, then output is 20 (min time) but you getting 10..!
Ratnapal Shende
Here 2 persons can interview A, B within 20 mins. And A complete his interview in 20 mins..
If agents =1, A will take time 20. B take 40...
If agents =3, A, B, C take 20 mins D, E take 40mins
If agents = 4, then A, B, C, D take 20 mins,.. E take 20 mins..
If agents= 1, A take 20 mins, B take 40,C completes in 60,D =>80 and E need 100mins. Output for A:
20
- 1
Read the description again properly.. Their is constraint to determine time depending on the number of agents.. You are not considering agents any where. .... . Am I right?