|
|
back to boardwhy WA17????????????????????????????????????????????????????? #include <iostream.h> int main(){ unsigned long k,l,n,sumM=0,i,kk,ll,g1,g2;cin>>k>>l>>n;kk=k;ll=l; for(i=0;i<n;i++){ g1=0;g2=0; if(kk>0&&i!=(n-1)){ g1=1;kk--; } else if(i==(n-1)){ g1=kk;g2=ll; //cout<<kk<<" "<<ll<<" "<<i<<endl; } if(g1>g2){ sumM+=3; } else if(g1==g2) { sumM+=1; } } cout<<sumM<<" "; /*sumM=0;kk=l;ll=k; for(i=0;i<n;i++){ g1=0;g2=0; if(kk>0&&i!=(n-1)){ g1=1;kk--; } else if(i==(n-1)){ g1=kk;g2=ll; //cout<<kk<<" "<<ll<<" "<<i<<endl; } if(g1<g2){ sumM+=3; } else if(g1==g2) { sumM+=1; } } cout<<sumM;*/ sumM=0;kk=k;ll=l; for(i=0;i<n;i++){ g1=0;g2=0; if(kk!=ll&&ll>0&&i!=(n-1)){ g2=1;ll--; } else if(i==(n-1)){ g1=kk;g2=ll; //cout<<kk<<" "<<ll<<" "<<i<<endl; } if(g1>g2){ sumM+=3; } else if(g1==g2) { sumM+=1; } } cout<<sumM;
return 0; } Re: why WA17????????????????????????????????????????????????????? Try test 40446 59850 50506, I think yr output is wrong Re: why WA17????????????????????????????????????????????????????? are answers 131397 31102?thank! Re: why WA17????????????????????????????????????????????????????? No, 131397 3 I think Re: why WA17????????????????????????????????????????????????????? My AC program gives 131397 3 Re: why WA17????????????????????????????????????????????????????? THANK!I THINK I HAD PROBLEMS WITH MINIMAL POINTS IN OUTPUT. Re: why WA17????????????????????????????????????????????????????? Posted by awpris 8 Mar 2007 23:08 Test: 40446 59850 50506 My solution: 131397 3 No, WA 17... ??? |
|
|