VAR flag:ARRAY[
FOR i:=
FOR i:=N DOWNTO
BEGIN sum:=
WHILE j<=N AND NOT found DO
BEGIN sum:=sum+flag[j];
IF sum=A[i]+
END;
A[i]:=j;
END;
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/23041.html
VAR flag:ARRAY[
FOR i:=
FOR i:=N DOWNTO
BEGIN sum:=
WHILE j<=N AND NOT found DO
BEGIN sum:=sum+flag[j];
IF sum=A[i]+
END;
A[i]:=j;
END;
[