MIME Type puzzle discussion

Pretty sure the last dataset is still bugged with C++, my solution is completing in 48ms locally and typically under 32ms on the CodinGame IDE, I have also timed the printing of the output buffer locally which is under 1ms. Even still I am getting timed out only on the last dataset.

Code is here: CodinGame Mime Type - Pastebin.com

If it requires optimization further than this then it surely should not qualify as an easy puzzle.

1 Like

@Leweh:
I agree, as long as this puzzle is in the easy category, the solution shouldn’t require advanced optimizations. Especially considering that they are not necessary in the other languages.

Is it possible to beat the ā€œLarge Datasetā€ test on C++? Tried it for a while and have 100% in validation but this test still has timeout.

1 Like

The same thing is being discussed in the several posts literally just above yours.

My program got the ā€œProcess has timed out.ā€ verdict in the ā€œLarge datasetā€ sample test case but it still got 100% score when submitted.

1 Like

Hi, i’m using c++ and a unoredred_map, but i kept failing the 5th test, (Large dataset test), however it seems my code was almost as efficient as it could be, so i submitted it and passed every single test, includind the 10th test (Large dataset test), so i guess there’s a bug that came back, gl everyone

2 Likes

never doubt your code, when it fails it’s always the test that’s the problem !

Not always; it just so happens that’s the case for this puzzle.

Can someone help me with my C++? I was using this problem to relearn it (didnt use it in decades).

I am hitting the time limit in the last test case. I believe I’m not doing nothing wrong algorithmically, I think it must be something that in C++ is time consuming.

Can someone spot it?

[Mod edit: Please avoid posting codes on the forum.]

Please refer to the messages just above yours. This is actually a known issue in C++ related to this puzzle. If you check the previous messages just above yours, you’ll find some discussion about it. I’ll report it to the staff as well, though that won’t happen any time soon (because I’ve already submitted a few other bug reports that are still pending).

oh, sorry, didn’t check other messages. As this was my first exercise in C++ I assumed the issue should be on me. thanks!

In C it is pure pain.
The line lengh is unknown so it just copy 257 chars everytime which ends up being garbage data at the end.
I have to do
if(EXT[j] != 0)
To get rid of the trash data.
Everything pass except the large dataset because of time constraint as if my code was not optimized but it is. It’s just that I have to add these extra loop to clean the garbage that codingame is not able to properly formulate because they don’t add a simple fckin \0 like anyone with triple digit iq… trully pathetic

EDIT : changing a comment makes me get 100%.
Mods, your website sucks xd

Nothing to do with mods. Mods don’t create or moderate that puzzle, nor do mods own this website.