-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Presents.cpp
More file actions
40 lines (33 loc) · 777 Bytes
/
A_Presents.cpp
File metadata and controls
40 lines (33 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
////https://codeforces.com/contest/136/problem/A
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int N = 1e5 + 5;
int solve(int a,vector <int> &v){
}
void solve(){
int n;cin>>n;
vector <pair<int,int>> v(n+1);
for(int i=1;i<=n;i++){
int x;cin>>x;
v[i] = {x,i}; //who get the gift from whom(i get the gift from x)
}
// first approach
// for(int i=1;i<=n;i++){
// for(int j=1;j<=n;j++){
// if(v[j].first==i){
// cout<<v[j].second<<" ";
// break;
// }
// }
// }
// second approach
sort(v.begin(),v.end());
for(int i=1;i<=n;i++){
cout<<v[i].second<<" ";
}
}
int main() {
solve();
}