Current work

This commit is contained in:
2026-08-03 19:03:58 +01:00
parent b48299efb7
commit a79ff12290
46 changed files with 1345 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int main() {
freopen("shuffle.in", "r", stdin);
freopen("shuffle.out", "w", stdout);
int n;
cin >> n;
vector<int> unshuffle(n);
for (int i = 0; i < n; i++) {
int tmp;
cin >> tmp;
unshuffle[i] = tmp - 1;
}
vector<int> ids(n);
for (int i = 0; i < n; i++) {
cin >> ids[i];
}
vector<int> tmp(n);
for (int i = 0; i < 3; i++) {
for (int j = 0; j < n; j++) {
tmp[j] = ids[unshuffle[j]];
}
swap(tmp, ids);
}
for (int i = 0; i < n; i++) {
cout << ids[i] << '\n';
}
}