vector <PINT> V; int N; int a[MAXN]; int x; int main () { cin >> N; REP(i,N) { cin >> x; V.push_back(make_pair(x,i)); } sort(V.begin(),V.end()); REP(i,N) a[V[i].second] = i; }