|
|
вернуться в форумWA#3, why!!! Послано Bobur 2 мар 2008 16:08 var n, k, dn : byte; u, v, t : single; begin read(n, k, u, v); t := (k - 1) * v + 15; if (n-1)*u < t+5 then n := 1 else begin dn := TRUNC(t/u); t := t - dn * u; if u - t < v then inc(dn, TRUNC(t/(u-v))); dec(n, dn); end; if n < 1 then n := 1; writeLn(n); end. where is my wrong!! pls give me tests!! Edited by author 02.03.2008 18:44 Re: WA#3, why!!! Послано mai7 2 мар 2008 23:26 Are you taking into concideration, time of taking Petya down to 1-st floor? Re: WA#3, why!!! Послано Emil 2 мар 2008 23:45 I've the same problem. Please help if yoy have already korrected it! Re: WA#3, why!!! Послано mai7 3 мар 2008 03:04 How do you calculate time if he if going down to x-th floor? Re: WA#3, why!!! Послано Emil 3 мар 2008 18:20 i don't understand you. Do you speak Russian?? help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Послано Bobur 5 мар 2008 00:04 i corrected it but i've WA#3 yet, please give me tests!!! var n, k, dn : integer; u, v, t : real; begin read(n, k, u, v); t := (k - 1) * v + 15; if (n-1)*u < t+5 then n := 1 else begin dn := TRUNC(t/u); t := t - dn * u; dec(n, dn); if (n-1)*v*2+5+t>(n-1)*u then n := 1 else if (n-1)*v*2+5+t=(n-1)*u then n := 2 else if u <= 2 * v then n := 1 else dec(n, TRUNC(t/(u-2*v))); if n < 1 then n := 1; end; writeLn(n); end. Re: help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Peter not required 15 seconds to leave Elevator if he use Elevator he too not required 15 seconds to go out. P.S. Bad English Edited by author 05.03.2008 02:50 Re: help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Послано Bobur 5 мар 2008 22:37 i corrected my code, but yet WA#3, pls i need help!!!!!!! var n, k, dn : integer; u, v, t : real; begin read(n, k, u, v); t := (k - 1) * v + 15; dn := TRUNC(t/u); t := t - dn * u; n := n - dn; if (n - 1)*2*v+5+t>(n-1)*u then n := 1 else if (n - 1)*2*v+5+t=(n-1)*u then n := 2 else dec(n, TRUNC(t/(u-2*v))); writeLn(n); end. now, i've AC, but this is another way!!! Послано Bobur 6 мар 2008 18:59 |
|
|