CHEFHACK WA

chefhack
wa

#1

Hi! I can’t seem to figure out the error in the logic for this code. It seems pretty close to the editorial given. Could anyone just give me any direction or even a test case for which this would fail? I tried both, the DFS and the BFS implementation. Below is the link for the BFS implementation.

http://www.codechef.com/viewsolution/1724561


#2

You should print long long variable using specifier “%lld”. Or just use cout.
It is fine to mix scanf and cout.

Also your implementation appears to be too slow. It gets TLE for some cases.


#3

Thanks a lot… :slight_smile: