← Back to topics
Topic

z-musicians

A
Asmirasmir
Here's my code , i kind of optimized it so it doesn't give TLE or some memory errors.
But i get wrong result on testcase: 5,8,10.
I'm sort of lost with it , i can't find any logical faults.

http://www.z-trening.com/new/www/html/submit.php?submit=7100044969&subm_code=1
A
Asmirasmir
pls help im stuck -.- i did it in something like 10 ways this one got the best results.
D
Daniel93
You declare for every function call a new queue , thats to much memory. That's the reason for the TLE. The WA you get is cause you check function is wrong.
D
Daniel93
Go trough the whole field and if you find a free block, then call bfs.