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 1607. Taxi

Why?
Posted by n3v3r_die 18 Feb 2012 14:55
#include <iostream>
using namespace std;
int taxi(int a,int b,int c,int d){
if ((a+b)>c) {return c;}
a+=b;
if ((c-d)<a) return a;
c-=d;
taxi(a,b,c,d);
}
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<taxi(a,b,c,d);
    return 0;
}

Wrong answer test #1
Re: Why?
Posted by Stefan Eniceicu 3 Jun 2012 15:42
"<=" and ">=" in those ifs.
there is one more case where a >= c where you need to return a.