×

# [closed] WA in spoj GSS1

 0 http://www.spoj.com/problems/GSS1/ https://ideone.com/WtT3xh Getting WA repeatedly . Can anyone help?? asked 15 Nov '14, 13:29 1★abeyaar 334●2●21●40 accept rate: 30%

### The question has been closed for the following reason "The question is answered, right answer was accepted" by abeyaar 22 Dec '14, 10:09

 1 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. answered 16 Nov '14, 12:08 1.1k●2●15●22 accept rate: 39% 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 (16 Nov '14, 18:28) abeyaar1★ http://discuss.codechef.com/questions/55307/segment-tree-java-code-explanation Can you look into this? (16 Nov '14, 18:33) abeyaar1★ @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 (08 Dec '15, 23:20)

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,768
×1,137

question asked: 15 Nov '14, 13:29

question was seen: 2,404 times

last updated: 08 Dec '15, 23:20