I don't think the problem is push_back, passing vectors as value,clearing
memory or anything like that. The program hits an stack overflow because of
the algorithm itself.

You can't solve the large dataset with such a naive approach, I recommend
you read the contest analysis for a way to solve the large dataset.

Carlos Guía


On Fri, May 13, 2011 at 11:58 AM, Axel Freyn <[email protected]> wrote:

> Hi Quasar
>
> On Fri, May 13, 2011 at 5:45 PM, quasar <[email protected]> wrote:
>
>> Hi shubham,
>>
>> Make sure you clear your container after finishing every test case.
>> That should solve the problem.
>>
>
> That's already done: The containers are local variables inside the
> while-loop, so they are deleted after each loop (=after each testcase)
>  Just try it: If you take the first test case on which the code segfaults,
> and then create an mini-test-file only containing this test case, the code
> also segfaults...
>
>
> Axel
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to