Hi, Your code seg faults with both kinds of input.
Thanks, Vinit - - - - - Check input and accepted output for over 6 *,000* problems on uDebug <http://www.udebug.com/>! Now including problems from* ACM-ICPC Live Archive* and *Google Code Jam*! Find us on Facebook <https://www.facebook.com/pages/Udebug/1458086424467115>. Follow us on Twitter <https://twitter.com/uDebug>. On Sat, Sep 5, 2015 at 12:04 PM, yatingarg12 <[email protected]> wrote: > # include <iostream> > using namespace std; > int main() > {int n,c,p,a[100],x,y; > cin>>n; > for(int i=0;i<n;i++) > {cin>>c>>p; > for(int j=0;j<p;j++) > {cin>>a[j];} > for(int j=0;j<p-1;j++) > for(int k=j+1;k<p;k++) > {if(a[j]+a[k]==c){x=j+1;y=k+1; break;}} > cout<<"Case #"<<i+1<<": "<<x<<" "<<y<<endl;} > 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 [email protected]. > To post to this group, send email to [email protected]. > 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 [email protected]. To post to this group, send email to [email protected]. 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.
