|
|
back to boardHELP!!! Posted by Saturn 31 Jul 2004 10:01 My program gives right answer all tests in the forum but T've got WA#2.Please give me some test Thanks Re: HELP!!! Posted by Saturn 31 Jul 2004 10:26 Oh,I got AC now! Re: HELP!!! I have WA #2 too. Can you give me some tests? Re: HELP!!! Posted by Saturn 31 Jul 2004 23:32 Some tests: 1 100 2 4 ->6 1 300 4 8 ->0 1 400 4 2 ->111 You can use this full search program to check: ////////////// var x,y,k,b,p,q:longint; function kt(s:longint):longint; var a:array[1..40]of longint; sd,i,j:longint; begin sd:=0; repeat inc(sd); a[sd]:=s mod b; s:=s div b; until s=0; j:=0; for i:=1 to sd do if a[i]=1 then inc(j) else if a[i]>1 then begin kt:=0; exit; end; kt:=j; end; begin read(x,y,k,b); p:=0; for q:=x to y do if kt(q)=k then inc(p); writeln(p); end. ///////// Good luck! Re: HELP!!! Thank you Saturn. |
|
|