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 1638. Bookworm

WA 10
Posted by rakeshvarna 24 Nov 2008 23:16
wht am i missing here?

#include<stdio.h>

int main()
{
    int th,co,n1,n2,z;
    long s;
    scanf("%d %d %d %d",&th,&co,&n1,&n2);
    if(n2>n1)
    {
        z=n2-n1;
        s=2*z*co+((z-1)*th);
    }
    else
    {
        z=n1-n2;
        s=((2*z)+1)*co+(z+1)*th-1;
    }
    printf("%ld\n",s);
    return 0;
}
Re: WA 10
Posted by BlackShark 19 Dec 2008 00:10
Please tell me why WA5
Re: WA 10
Posted by Egor 21 Apr 2012 00:35
10 1 4 3