回帖:引用第2楼bluetear于2006-08-03 21:20发表的“”:
I got Compilation error or Crash (at #test 5 access violation),but my program is so quickly!
偶的弱程序:
用的类似背包问题的算法。
var tt,top,k,b:int64;
i,j,x,y:longint;
q:int64;
a:array[0..32]of longint;
f:packed array[0..1000000000]of boolean;
total:packed array[0..1000000000]of byte;
begin
read(x,y,k,b);
q:=1;
top:=0;
repeat
a:=q;
inc(top);
q:=q*b;
until q>y;
dec(top);
f[0]:=true;
total[0]:=0;
tt:=0;
if k1 then
for i:=0 to top do
begin
for j:=y downto a do
if total