|
|
вернуться в форумI have WA#10. Can you help me? I have WA#10. Can you help me? here is my code: program _1191; {$APPTYPE CONSOLE} uses SysUtils; var k:array[1..100]of longint; l,n,i,q,z:longint; begin reset(input,'input.txt'); rewrite(output,'ouput.txt'); read(l,n); q:=1; z:=0; for i:=1 to n do begin read(k[i]); z:=z+k[i]; if l<z then begin write('YES'); halt(0); end else while l>z+q*k[i] do inc(q); l:=z+q*k[i]; q:=1; end; write('NO'); end. Edited by author 18.03.2009 19:38 |
|
|