- 迎春舞会之交谊舞
- 2012-08-05 21:40:12 @
var
n,i,j,k,p,t:longint;
a,b:packed array[0..1500]of longint;
begin
readln(n);
for i:=1 to n do
begin
read(a[i]);
b[i]:=a[i]-a;
end;
for i:=1 to n do
begin
p:=i;
while b[p]=0 do dec(p);
write(a[i]-a[p-1]-b[p]+1,' ');
dec(b[p]);
end;
end.
#include
using namespace std;
int main()
{
long n,t,a[1502],b[1502],c[1052];
cin >> n;
for (int i = 1; i > a[i];
c[i] = a[i] - a[i - 1];
t = i;
while (c[t] == 0)
--t;
b[i] =a[i] - a[t-1] -c[t] + 1;
--c[t];
}
for (int i = 1; i
0 条评论
目前还没有评论...