Help in APIO 2015 skyscrapers

I have a doubt in
I wrote a solution for 57 points but getting only 36 because of wa on a test file in subtask 4

I also checked for overflows and other things but can’t figure out the mistake even after trying for a long time
the ideal solution is O(nm) using 0-1 bfs and some manipulations
heres my solution

the second solution is to use djikstra and some manipulations with huge constant optimizations
my solution is getting wa on the same test case

heres the editorial for the question(my approach is same/similar) -

can someone help

Read the constraints of Subtask 4 carefully :slight_smile:

1 Like

the error was really very silly got rid of it
but now I am getting mle on some later testcase in subtask 4(same testcase in both solution)

can you help - (0-1) bfs (djikstra)

thanks @admin