|
|
вернуться в форумWhat ir wrong???Could someone give me extrea tests,please?? Here is my program, if you can, give me some extra tests. Thank you!!! program The_time; var a:array[0..10000] of byte; st : array[1..50] of longint; n,k,i,j : integer; bool:boolean; Begin readln(n,k); for i:=1 to k do read(st[i]); a[0]:=1; for i:=1 to n do a[i]:=0; for i:=1 to n do Begin bool:=false; for j:=1 to k do if i-st[j]>=0 then if a[i-st[j]]=2 then Begin a[i]:=1; break; End else if a[i-st[j]]=1 then if bool=false then bool:=true; if(bool)and(a[i]=0) then a[i]:=2; End; writeln(a[n]); End. |
|
|