solved sequence equation

Signed-off-by: ayham <altffour@protonmail.com>
This commit is contained in:
ayham 2021-05-10 10:41:36 +03:00
parent a38bf2270a
commit decc00709e
No known key found for this signature in database
GPG Key ID: 81D38F7122AFCC94
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> p(n);
for (int i = 0; i < n; i++) cin >> p[i];
for (int x = 1; x <= n; x++) {
auto x1_index = find(p.begin(), p.end(), x) - p.begin();
auto x2_index = find(p.begin(), p.end(), x1_index+1) - p.begin();
cout << x2_index+1 << endl;
}
return 0;
}