My code generates results exactly according to the rules and the sample i/0, but codechef wont accept my answer. The question is from the august challenge, rainbow array. What might be the possible reasons of the problem???
You shouldn’t ask anything during an ongoing challenge. Ask them after the contest ends.
I looked it up, and the verdict to your submissions is “Wrong answer”. This means, that your solution doesn’t compute the correct result for all test cases.
Codechef has a lot of hidden test cases. So even if your program works with the 2-3 test cases from the problem statement, it still can be wrong and receive WA. Sometimes these hidden test cases contain very special cases, that you have to handle differently. Sometimes these hidden test cases contain very large intstances, e.g. arrays of length 10^5. Sometimes just normal small tests.
Either way, if you receive WA your program computes (sometimes) wrong answers. Check it again, and if you can’t find a solution you can post your code tomorrow after the contest has ended.