I have tested in all my self generated test cases and it is giving the right answer but when I submit it in icpc Live Archive it gives wrong answer. Please Help. My code is here.
This question is just the same as this one. As I tested your solution with those of spoj one, I got this test case:
5
143 64 234 87 5
Your code gives 207, while the output is 253.
1 Like