Check if you have handled the imputs correctly: there’s a menu button at the topright of the box for test cases, it shows you what the inputs for each case is and what the expected result should be.
If you look at the inputs for this test case, it’s very simple and only very few conditions are needed to pass it (more needed to pass all, depending on what your strategy is). Check if you have these conditions correct in your code.
Hey there!
4 years after… I’m a beginner and there is something that I don’t understand.
I’m writing my code in Java, and the arrays seem to be reversed compared to this game coordinates.
I only get timeout, which means that nothing outputs from my loop I guess, but when I test my code on my IDE (Eclipse), it works fine.
Moreover, S.C. Yeo talked about a menu button where you can see the input and the expected output, but I don’t see anything anywhere, does it still exist ?
It’s not even going into the problem itself. It’s timing out after I read the first data to construct my map, before it goes in the while loop. I’ve tried all different approaches I know… Using char type or converting to int. It’s still timing out…
for (int i = 0; i < H; i++)
{
char LINE[201];
scanf("%[^\n]", LINE); fgetc(stdin);
line = ft_split(LINE, ' ');//function to take of the space character between the numbers, and to arrange them in a double array
for (int j = 0; j < W; j++)
map[i][j] = atoi(line[j]);
}
I use a double pointer int type because it’s easier for me to work with int’s. I understand the conversion may take some time. But I’ve tried using char’s and it gives the same result
I can post it here… But do you think it’s relevant? I mean, all the tests are passing, only 3 and 5 are timing out. The map on test 4 is bigger than the map on test 3, and it’s working great. Is it possible that those two tests have different response time?
Okay, thanks to 5DN1L I found that my code times out when H > W. Already trying different approaches and at least I can already get Indy inside the tunnels. Thought that if I make the conversion to int turn by turn it would work, unfortunately it’s still timing out with this new solution. I discovered that the 150ms time constraint is not for turn, but for the whole game ): Well anyway thank you 5DN1L for the help!
Could it be the same issue as the guy above you? You may consider checking the possible reasons of timing out - reading inputs should NOT cause a timeout (unless your code reads them indefinitely without doing anything else…).
Hello !
Everytime I try my code, it says the same : “Timeout: your program did not provide an input in due time.”
Even when I remove EVERYTHING and just put a while(true) { echo “1”;}
Can the ping be the problem?
The thing is my algorithm is only a switch for each type possible and if conditions to do the correct calculation. I don’t know if there is a faster way to do it