PNTNG - Editorial

i am not able to get where i am wrong CodeChef: Practical coding for everyone

@admin can anyone see y im getting a wrong answer for this submission… I used bubble sort… a tle is expected but its giving wrong answer… Test cases and max values seem fine… CodeChef: Practical coding for everyone

CodeChef: Practical coding for everyone this is an accepted solution… while CodeChef: Practical coding for everyone shows runtime error…can admins tell me why i got an error in the second one even though code is same…

I am getting wrong answer, plz tell me why…
http://www.codechef.com/viewsolution/4136227

CodeChef: Practical coding for everyone help

Can’t understand , how we have to paint only n*m cells…??and what’s this mean"vertical column in layer"…??

optimization : Inside the for loop add if(topaint==0)break;

n and m can not be stored in int. n * m <= 10^12

hell man :\

provide the strong test cases as many of us have failed…

i don’t think so…

1 Like

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 :

http://discuss.codechef.com/questions/42356/doubt-regarding-tle-wrong-answer

@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.
https://www.codechef.com/viewsolution/36661491