Pagini recente » Cod sursa (job #2591235) | Cod sursa (job #1325034) | Cod sursa (job #2980054) | Cod sursa (job #1080083) | Cod sursa (job #2944319)
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> v;
int poz[30005];
struct mama
{
int val, poz;
};
mama rez[30005];
bool cmp(mama a, mama b)
{
return a.val < b.val;
}
int main()
{
ifstream cin("schi.in");
ofstream cout("schi.out");
int n;
cin>>n;
v.push_back(0);
for(int i = 1; i <= n; i++)
{
cin>>poz[i];
v.push_back(i);
}
for(int i = n; i >= 1; i--)
{
rez[i].val = v[poz[i]];
rez[i].poz = i;
v.erase(v.begin() + poz[i]);
}
sort(rez + 1, rez + n + 1, cmp);
for(int i = 1; i <= n; i++)
cout<<rez[i].poz<<'\n';
return 0;
}