# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
857615 | vgtcross | Art Collections (BOI22_art) | C++17 | 1249 ms | 1852 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define MODE 0
using namespace std;
using ll = long long;
int publish(vector<int> r)
#if MODE
{
cout << "? ";
for (int i : r) cout << i << ' ';
cout << endl;
int ans;
cin >> ans;
return ans;
}
#else
;
#endif
void answer(vector<int> r)
#if MODE
{
cout << "! ";
for (int i : r) cout << i << ' ';
cout << endl;
}
#else
;
#endif
void solve(int n) {
vector<int> v(n);
vector<int> r(n);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) r[j] = (i+j) % n + 1;
v[i] = publish(r);
}
vector<int> ans(n);
for (int i = 0; i < n; ++i) {
ans[(v[i] - v[(i+1)%n] + n - 1) / 2] = i+1;
}
answer(ans);
}
#if MODE
int main() {
cin.tie(0) -> sync_with_stdio(0);
int n;
cin >> n;
solve(n);
}
#endif
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |