|
|
back to boardWA 7 Whats wrong? Posted by tanas 3 Jun 2008 20:19 This is my program. I have read all forum but didn't find answer. Please help {$Q-,R-,S-,I-,O+} program z1602; uses math; var a: array [1..101] of extended; u, v, k, min: extended; pos, i, n: longint; begin read(n,k,u,v); a[1]:= (n-1)*u; for i := 2 to n do a[i]:= max((n-i)*u,(k-1)*v+15)+(i-1)*v+5+(i-1)*v; min:= a[1]; pos:= 1; for i := 2 to n do if a[i] + 1e-9 < min then begin min:= a[i]; pos:= i; end; writeln(pos); end. Re: WA 7 Whats wrong? read problem more attentively. when you find pos, you way from 2 to N, but right way from N downto 2... and you get AC :) Edited by author 06.07.2008 02:43 |
|
|