# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
580875 | amunduzbaev | Art Collections (BOI22_art) | C++17 | 1661 ms | 584 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 "art.h"
#include "bits/stdc++.h"
using namespace std;
#ifndef EVAL
#include "sample_grader.cpp"
#endif
#define ar array
void solve(int n){
vector<int> r(n);
auto ask = [&](int in){
vector<int> a(n);
for(int i=0;i<n;i++){
a[i] = (in + i) % n + 1;
}
return publish(a);
};
for(int i=0;i<n;i++){
r[i] = ask(i);
}
vector<int> pos(n), res(n);
for(int i=0;i<n;i++){
pos[i] = (r[i] - r[(i + 1) % n] + n - 1) / 2;
res[pos[i]] = i + 1;
}
//~ for(int i=0;i<n;i++) cout<<pos[i]<<" ";
//~ cout<<"\n";
answer(res);
}
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... |