It won't work for the large data set because you have only made an array of
size 100 and you might need an array of size 2000.

On Sat, Sep 5, 2015 at 7:30 AM, 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/0cc78c96-b7c8-4421-a21c-b2029c4d4fce%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/CAECKw-Ok9HoNbhb2FArAhZvs88zkAQcXA8FCk%3DgtH3WK7DT6hw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to