ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1534. Football in Gondor

why WA17?????????????????????????????????????????????????????
Posted by CHIDEMYAN SERGEY 3 Mar 2007 16:57
#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?????????????????????????????????????????????????????
Posted by Todor Tsonkov 3 Mar 2007 17:00
Try test 40446 59850 50506, I think yr output is wrong
Re: why WA17?????????????????????????????????????????????????????
Posted by CHIDEMYAN SERGEY 4 Mar 2007 00:53
are answers 131397 31102?thank!
Re: why WA17?????????????????????????????????????????????????????
Posted by Todor Tsonkov 4 Mar 2007 01:11
No, 131397 3 I think
Re: why WA17?????????????????????????????????????????????????????
Posted by Todor Tsonkov 4 Mar 2007 10:36
My AC program gives 131397 3
Re: why WA17?????????????????????????????????????????????????????
Posted by CHIDEMYAN SERGEY 4 Mar 2007 14:40
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...
???