Kattis Solution to lost lineup in C++



#include<bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]){
int n;
cin >> n;
std::map<int, int> order;
int key;
for (int i = 2; i <= n; ++i) {
cin >> key;
order[key] = i;
}
cout << "1 ";
for (int i = 0; i < n-1; ++i){
cout <<order[i]<<" ";
}
return 0;
}



Click here for the problem

Comments

Popular posts from this blog

Basketball One-on-One : Kattis Solution in C++

Kattis Solution to Reverse Binary in C++

Kattis Solution to Odd Man out In cpp