We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I think my solution is similar, but doesn't work for all input cases, any idea why?
//header files bla blaintmain(){unsignedints,t,a,b,m,n;cin>>s>>t;longlonginthouse=(t-s);cin>>a>>b;cin>>m>>n;longlongintd;longlonginti,j;intcount=0,count1=0;for(i=0;i<m;i++){cin>>d;longlongintx=(a+d);if(x>=s&&x<=t)count++;}for(j=0;j<n;j++){cin>>d;longlonginty=(b-d);if(y>=s&&y<=t)count1++;}cout<<count<<endl<<count1;return0;}
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
I think my solution is similar, but doesn't work for all input cases, any idea why?