Getting WA repeatedly . Can anyone help??
Consider this testcase:
5
3 -5 4 7 0
1
1 5
Your output is 14 (3+4+7). The correct answer is 11 (4+7). The problem requires you to print the maximum sum of a subrange in a given range. If the given range is 1 5 and you choose a subrange 1 4 your sum will be 9 (not 14 as your output, you can’t ignore negative numbers). The maximum sum occurs in the subrange 3 4 with as sum of 11.
1 Like
Yeah I got my mistake…however the correct java program is giving TLE even with fast I/O and there are only 7-8 successfull java submissions for this problem. So I am now trying in C
Can you look into this?
@abeyaar …Can you please tell me the change which helped you out.I am getting WA on 9th Judge, used the concept just like you …My code is https://ideone.com/FqZ6Zq