Https://ide.codingblocks.com/#/s/29814

https://ide.codingblocks.com/#/s/29814
the question is
https://hack.codingblocks.com/contests/c/509/1302
what s a error in the code.

Your logic is wrong.
One of the cases it will fail
INPUT:
1
5
1 0 1 1 0
EXPECTED OUTPUT: 1 4
OUTPUT: 0 3