Re: [gcj] Please help in finding error. It works good still error is shown

2015-09-06 Thread uDebug
Hi Luke,

​
> ​
> I disagree with this diagnosis. I think it faults with the large data set
> and gets the answer right if you make your array big enough.​


​You're right. My bad. I made a mistake while testing with both kinds of
input. The code indeed seg faults with only the large data set. ​

Thank you for clearing things up and apologies for any confusion.

Vinit

- - - - -
Check input and
​accepted ​
output for over
*​6​,​00​0* problems on uDebug !

​Now including problems from* ACM-ICPC Live Archive* and *Google Code Jam*!​


Find us on Facebook .
Follow us on Twitter .

On Sun, Sep 6, 2015 at 2:26 PM, Luke Pebody  wrote:

> ​​
> I disagree with this diagnosis. I think it faults with the large data set
> and gets the answer right if you make your array big enough.
>
> A quick note: the 'break' breaks you out of the 'for (k = j + 1; k < p;
> k++)' loop, but not the 'for (j = 0; j < p - 1; j++)' loop.
>
>
>
> On Sat, Sep 5, 2015 at 7:47 AM, uDebug  wrote:
>
>> Hi,
>>
>> Your code seg faults with both kinds of input.
>>
>> Thanks,
>>
>> Vinit
>>
>> - - - - -
>> Check input and
>> ​accepted ​
>> output for over
>> ​6​
>> *,​00​0* problems on uDebug !
>>
>> ​Now including problems from* ACM-ICPC Live Archive* and *Google Code
>> Jam*!​
>>
>>
>> Find us on Facebook
>> . Follow us on
>> Twitter .
>>
>> On Sat, Sep 5, 2015 at 12:04 PM, yatingarg12 
>> wrote:
>>
>>> # include 
>>> using namespace std;
>>> int main()
>>> {int n,c,p,a[100],x,y;
>>> cin>>n;
>>> for(int i=0;i>> {cin>>c>>p;
>>> for(int j=0;j>> {cin>>a[j];}
>>> for(int j=0;j>> for(int k=j+1;k>> {if(a[j]+a[k]==c){x=j+1;y=k+1; break;}}
>>> cout<<"Case #"<>> return 0;
>>> }
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-code@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/4842d4f2-732d-4490-8c6c-384d954da67a%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/CA%2BXgmOU79UO%3DMHvgGz4uLMfnPBdxg_%3DquX0VR7u2%3DPTty_%2BTMw%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAECKw-PQ4EnqCrte5B0%2B78x3bscVg2Di4u4Rke4fAxr_TdiwmA%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CA%2BXgmOX5Sriykp03dbiJVZGcjmNTKRd%2Bq_MzCc8ZNu%3D03svLwA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Please help in finding error. It works good still error is shown

2015-09-06 Thread Luke Pebody
I disagree with this diagnosis. I think it faults with the large data set
and gets the answer right if you make your array big enough.

A quick note: the 'break' breaks you out of the 'for (k = j + 1; k < p;
k++)' loop, but not the 'for (j = 0; j < p - 1; j++)' loop.



On Sat, Sep 5, 2015 at 7:47 AM, uDebug  wrote:

> Hi,
>
> Your code seg faults with both kinds of input.
>
> Thanks,
>
> Vinit
>
> - - - - -
> Check input and
> ​accepted ​
> output for over
> ​6​
> *,​00​0* problems on uDebug !
>
> ​Now including problems from* ACM-ICPC Live Archive* and *Google Code Jam*
> !​
>
>
> Find us on Facebook
> . Follow us on
> Twitter .
>
> On Sat, Sep 5, 2015 at 12:04 PM, yatingarg12 
> wrote:
>
>> # include 
>> using namespace std;
>> int main()
>> {int n,c,p,a[100],x,y;
>> cin>>n;
>> for(int i=0;i> {cin>>c>>p;
>> for(int j=0;j> {cin>>a[j];}
>> for(int j=0;j> for(int k=j+1;k> {if(a[j]+a[k]==c){x=j+1;y=k+1; break;}}
>> cout<<"Case #"<> return 0;
>> }
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/4842d4f2-732d-4490-8c6c-384d954da67a%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CA%2BXgmOU79UO%3DMHvgGz4uLMfnPBdxg_%3DquX0VR7u2%3DPTty_%2BTMw%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PQ4EnqCrte5B0%2B78x3bscVg2Di4u4Rke4fAxr_TdiwmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Please help in finding error. It works good still error is shown

2015-09-05 Thread yatingarg12
# include 
using namespace std;
int main()
{int n,c,p,a[100],x,y;
cin>>n;
for(int i=0;i>c>>p;
for(int j=0;j>a[j];}
for(int j=0;j

Re: [gcj] Please help in finding error. It works good still error is shown

2015-09-05 Thread uDebug
Hi,

Your code seg faults with both kinds of input.

Thanks,

Vinit

- - - - -
Check input and
​accepted ​
output for over
​6​
*,​00​0* problems on uDebug !

​Now including problems from* ACM-ICPC Live Archive* and *Google Code Jam*!​


Find us on Facebook .
Follow us on Twitter .

On Sat, Sep 5, 2015 at 12:04 PM, yatingarg12  wrote:

> # include 
> using namespace std;
> int main()
> {int n,c,p,a[100],x,y;
> cin>>n;
> for(int i=0;i {cin>>c>>p;
> for(int j=0;j {cin>>a[j];}
> for(int j=0;j for(int k=j+1;k {if(a[j]+a[k]==c){x=j+1;y=k+1; break;}}
> cout<<"Case #"< return 0;
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/4842d4f2-732d-4490-8c6c-384d954da67a%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CA%2BXgmOU79UO%3DMHvgGz4uLMfnPBdxg_%3DquX0VR7u2%3DPTty_%2BTMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.