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

#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;
}
Try test 40446 59850 50506, I think yr output is wrong
are answers 131397 31102?thank!
No, 131397 3 I think
My AC program gives 131397 3
THANK!I THINK I HAD PROBLEMS WITH MINIMAL POINTS IN OUTPUT.
Test: 40446 59850 50506
My solution: 131397 3
No, WA 17...
???