Oh, okay. However, I feel like the question could have been a bit more clear on the conditions for this particular case.
for 1*1 matrix answer is x but your code prints y
Thanks a lot for pointing mistake, if there is only one block then it should contain x.
Thatās why its a tricky corner caseā¦
Thanks, is there even a brute force implementation anywhere? i canāt seem to get it right.
Try breaking down the problem like x > y and x < y.
You should find the logic if you do that.
1 1 4 1?
Codechef just want the people NOT to understand the question and spend 2 hours of brain cracking just to decide whether 1x1 will have min(x,y) or not .
Since n was small dp worked. but will the testerās (@rajarshi_basu) solution work for n upto 10^5 ? (If yes, why was n not 10^5 ? )
Letās say you were in doubt whether to print x or y when n=1 and m=1, (even though the question was quite clear), it would take you two tries to get AC at max, Assuming the rest of your code was right. So, donāt blame them because you are stupid.
Can you please suggest. What I am doing wrong in my code.
https://www.codechef.com/viewsolution/36022880
Thanks
1 1 4 1
Got the logic at the first attempt but havenāt seen the constraint which cost me 100 points .
But learning is still there.
Thanks
Check for 1 1 6 5. It should give 6 your code gives 5.
I never doubted that I am not a stupid,itās just that I didnāt expect them to be stupid too .
The most costly edge case Iāve ever suffered
They werenāt. 1500+ people figured it out, so must be just you