| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1350263 | dodjing | Art Collections (BOI22_art) | C++20 | 0 ms | 0 KiB |
#include <iostream>
#include <vector>
#include <numeric>
#include <unordered_map>
#include <cstdint>
#include <chrono>
#include "art.h"
#define ll long long
using namespace std;
void solve(int n) {
vector <int> aaa(n);
vector <int> ans(n);
for (int i = 0; i < n; i++) {
aaa[i] = i + 1;
}
int res_b, res_n, res_f;
res_n = publish(aaa);
res_f = res_n;
for (int i = 0; i < n - 1; i++) {
int temp = aaa[0];
for (int j = 0; j < n - 1; j++) {
aaa[j] = aaa[j + 1];
}
aaa[n - 1] = temp;
res_b = res_n;
res_n = publish(aaa);
int dif = res_n - res_b;
dif -= (n + 1);
dif /= -2;
ans[dif - 1] = aaa[n - 1];
}
int dif = res_f - res_n;
dif -= (n + 1);
dif /= -2;
ans[dif - 1] = aaa[1];
answer(ans);
}
int main() {
return 0;
}