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 1602. Elevator

Why WA on 3-th test..C++ ??
Posted by Progress 2 Jun 2008 21:46
#include <iostream>
using namespace std;

int main()
{
    long double u,v,r;
    int n,k;
    cin >> n >> k >> u >> v;
    r=(((k-1)*v)+15)/u;
    if(k==1)r=(k*v)/u;
    if(r+5>n)cout << 1 << endl;
    else cout << n-(int)r << endl;

    return 0;
}

Edited by author 02.06.2008 22:16

Edited by author 02.06.2008 22:17
Re: Why WA on 3-th test..C++ ??
Posted by freedevc 7 Nov 2008 05:38
Oh! I think that you are not right at r. Because the elevator goes down and then waits for 15 minute, after that it goes up. So your fomular computes r is wrong! ^_^.

Edited by author 07.11.2008 05:38