|
|
вернуться в форумWhy CE !!!!!!!!!!!!!!!!!!!!!!!!!!! Help Please!!!!!!!!!!!!!!!!!!!!!!!!!!! I compile my solution on my computer and it passes all my tests. But there it can't be compiled I usually get CE Here is my solution var a:array[1..1000]of integer; n,i,j:longint; begin read(n); if (n=1) then begin write(1); halt(0); end; if (n=0) then begin write(10); halt(0); end; while n<>1 do begin for i:=9 downto 1 do if n mod i=0 then begin inc(j); a[j]:=i; n:=n div i; i:=9; end; if n>1 then begin write(-1); halt(0); end; end; for i:=j downto 1 do write(a[i]); end. Edited by author 12.03.2007 22:25 Re: Why CE !!!!!!!!!!!!!!!!!!!!!!!!!!! Help Please!!!!!!!!!!!!!!!!!!!!!!!!!!! if n mod i=0 then begin inc(j); a[j]:=i; n:=n div i; i:=9; end; Just deleted bolded line and got WA. Edited by author 13.03.2007 02:31 Re: Why CE !!!!!!!!!!!!!!!!!!!!!!!!!!! Help Please!!!!!!!!!!!!!!!!!!!!!!!!!!! Послано Logic 13 мар 2007 10:23 Edited by author 14.03.2007 14:44 Re: Why CE !!!!!!!!!!!!!!!!!!!!!!!!!!! Help Please!!!!!!!!!!!!!!!!!!!!!!!!!!! stupid If you stupid dont think that all are stopid too!!! And study geometry!!! Edited by author 13.03.2007 22:03Re: Why CE !!!!!!!!!!!!!!!!!!!!!!!!!!! Help Please!!!!!!!!!!!!!!!!!!!!!!!!!!! replace "for i:= 9 downto 1 do begin ... end" with i:= 9; while (i>=1) do begin ... i = i - 1; end; Re: Why CE !!!!!!!!!!!!!!!!!!!!!!!!!!! Help Please!!!!!!!!!!!!!!!!!!!!!!!!!!! Послано GENIUM 14 мар 2007 14:44 |
|
|