# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
714405 | vjudge1 | Art Collections (BOI22_art) | C++17 | 0 ms | 208 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;
int n;
int f(int a){
vector<int> order;
for (int i = 1; i <= n; i++)
{
if(i == a) continue;
order.push_back(i);
}
order.push_back(a);
return publish(order);
}
int f_error(int a){
vector<int> order;
order.push_back(a);
for (int i = 1; i <= n; i++)
{
if(i == a) continue;
order.push_back(i);
}
return publish(order);
}
void solve(int N) {
n = N;
vector<int> ans(n, 0);
for (int i = 1; i <= n; i++)
{
for(auto j : ans) cout<<j<<" ";
cout<<endl;
int k = f(i);
int error = f_error(i);
cout<<k<<" "<<error<<endl;
if(n % 2 == 1){
int shift = (k - error) / 2;
int pos = (n + 1) / 2 - shift;
ans[pos - 1] = i;
}else{
int shift;
if(k - error < 0) shift = (k - error) / 2;
else shift = (k - error + 1) / 2;
int pos = n / 2 + 1 - shift;
ans[pos - 1] = i;
}
}
answer(ans);
}
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... |