Hello, I was solving this problem : http://codeforces.me/problemset/problem/486/B
Here is my submission : http://codeforces.me/contest/486/submission/15134351
The same code on ideone gives correct answer in both C++14 and C++ 5.1 : http://ideone.com/NUMK5T
There maybe something I'm doing wrong. Would he great if anyone could help.
Thanks Alot!
Maybe you should set nonzero values for array ans?