Cod sursa(job #3134292)

Utilizator AndreiKatsukiAndrei Dogarel AndreiKatsuki Data 28 mai 2023 20:49:00
Problema Schi Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <bits/stdc++.h>
#include <fstream>

using namespace std;

ifstream f("schi.in");
ofstream g("schi.out");

const int NMAX = 3e4 + 5;
int a[NMAX], n, loc;

void muta(int st, int dr){
    for(int i = dr; i >= st; --i){
        a[i + 1] = a[i];
    }
}

int main(){
    f >> n;
    for(int i = 1; i <= n; ++i){
        f >> loc;
        muta(loc, i);
        a[loc] = i;
    }
    for(int i = 1; i <= n; ++i){
        g << a[i] << "\n";
    }
    return 0;
}