Here is my code for the problem problem 525B- mysolution . I think I have understood the problem perfectly and coded it but aint able to find what mistake I am making and why i aint getting AC.. Can anyone help?? If you have any other way of solving this you can share that too and if you find a thing or two wrong in my code or concept, please feel free to explain me those!! Thank You guys!! :)
silly mistake => 10770669
It doesn't matter, you were just lucky :)
actually i think i should be very lucky, that in every test case a[] filled with even numbers !!! (somthing like 1/(2^200002) for every test case)
You should initialize your array a with zeroes since it is declared inside the main function: http://mirror.codeforces.com/contest/525/submission/10770670
Why so ?? If i declare it outside main then does it matter if i initailize it or not?? And can you tell me the reason for the same please!! :)
Well, if you declare an array or a variable as global(it is not inside a function) it is initialized with zeroes by default. But if you declare it inside a function(not necessarily inside the main function) it is filled with some random values. What keyvankhademi changed is line 17, but you don't need it, your is correct also. He got AC only because he was lucky :)
Thanks man!! And he got lucky because (i am asking) a[i]==1 where i>siz/2 is not present??
No, he got lucky because he got AC despite the uninitialized array :)