|
|
вернуться в форумWhy WA on 3-th test..C++ ?? #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++ ?? 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 |
|
|