Question : [https://hack.codingblocks.com/contests/c/509/216]
my code : [https://ide.codingblocks.com/#/s/30018]
in this code, output is correct byt in hackerblocks it is displaying wrong answer.
Question : [https://hack.codingblocks.com/contests/c/509/216]
my code : [https://ide.codingblocks.com/#/s/30018]
in this code, output is correct byt in hackerblocks it is displaying wrong answer.
I think your code is wrong
Here is one of the cases.
INPUT:
4 5
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
OUTPUT:
1, 2, 3, 4, 9, 8, 7, 6, 11, 12, 13, 14, 19, 18, 17, 16, -109012368, 32767, 4196042, 0, END
Which is wrong…
so what is the correct soln??
https://ide.codingblocks.com/#/s/30751
See this solution
I have made changes in your code.
Actually you were taking row and col opposite. Now it works well in all cases.