provide the strong test cases as many of us have failed…
i don’t think so…
I have provided test cases for as much codes as I could have done, please check one other thread in the discussions too where I have given some test cases.
please explain the 1st test case in detail. The problem is still unclear to me. what is meant by table should not be seen through top and no two vertical columns should be unpainted?
It will be better to choose std::multimap instead of std::map, for the simple reason that the cost can be same for more than one layer.
no need of multimap… you can add tk to the value stored along key ck in a map itself
I think using map is also correct. As we are only interested in cost and no. of tiles that can be painted with that cost.
I think you have misunderstood.To know why refer this link :
@achaitanyasai i do understand them… thats i wanted to clarify… i used the same logic but different sorting in the below comment… It is accepted solution…
ok… i understood
got TLE… have done the same O( HLOGH + H) implementation.