Cod sursa(job #59834)

Utilizator peanutzAndrei Homorodean peanutz Data 10 mai 2007 17:23:30
Problema Schi Scor 75
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <stdio.h>
#include <memory.h>

#define NMAX 30100

int n;

int main()
{
	int i;
	int x;
	int a[NMAX];

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

	scanf("%d", &n);

        memset(a, 0, sizeof(a));

	for(i = 1; i <= n; ++i)
	{
		scanf("%d", &x);

		memmove(a+x+1, a+x, sizeof(int)*(i - x));

		a[x] = i;
	}

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

	fclose(stdin);
	fclose(stdout);

	return 0;
}