# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
651618 | inksamurai | Art Collections (BOI22_art) | C++17 | 0 ms | 0 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"
void solve(int N){
int n=N;
vi pns(n);
rep(pvt,n){
vi a;
a.pb(pvt);
rep(j,n){
if(j==pvt) continue;
a.pb(j);
}
int u=ask(a);
a.erase(a.begin());
a.pb(pvt);
int v=ask(a);
assert((u+v-n+1)%2==0);
int z=(u+v-n+1)/2;
int x=u-z;
pns[x]=pvt;
}
answer(pvt);
}