Getting wrong on Spoj.https://ide.codingblocks.com/#/s/14679
MARBLES ques got ac on HackerBlocks but not on Spoj
Your code is absolutely correct ( just change your cout << ans << " "
to cout << ans << "\n"
). Actually, for this problem, the evaluation on SPOJ is kinda weird ( like it gives AC on doing ans=ans*
and WA on ans*=
) . So no need to panic.
1 Like
As I told you, they have a very strict and irrational judgement for this problem ( you can read it in the comments in spoj ). I tested your code and for all cases, it gave the correct answer. So your code is correct
1 Like