Cod sursa(job #113683)

Utilizator pandaemonAndrei Popescu pandaemon Data 11 decembrie 2007 02:16:08
Problema Schi Scor 5
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include<stdio.h>
#define LMAX 30000

int n,i,j,k,v[LMAX],v2[LMAX];

main()
{freopen("schi.in","r",stdin);
 freopen("schi.out","w",stdout);

 scanf("%d",&n);

 for(i=1;i<=n;i++) scanf("%d",&v[i]);

 for(i=n;i>=1;i--) {v[i]+=v2[i];
		    for(j=v[i];j<=n;j++) v2[j]++;}



 for(i=1;i<=n;i++) printf("%d\n",v[i]);}