# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
651115 | Specialistas13 | Art Collections (BOI22_art) | C++17 | 1 ms | 336 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;
void solve(int N) {
vector<int> order;
int poz[5000];
int comp[5000];
bool taken[5000];
int x, y, z, bad=0;
for (int i=1; i<=N; i++){
order.push_back(i);
poz[i]=0;
comp[i]=0;
taken[i]=false;
}
x=publish(order);
for (int i=1; i<=N-1; i++){
order.clear();
for (int j=N-i; j>=1; j--){
order.push_back(j);
}
for (int j=N-i+1; j<=N; j++){
order.push_back(j);
}
y=publish(order);
z=(x+y-((N-i)*(N-i-1)/2)-bad)/2;
comp[N-i+1]=z;
bad+=z*2;
}
for (int i=N; i>=2; i--){
poz[N-comp[i]]=i;
cout<<i<<" poz "<<poz[N-comp[i]]<<"\n";
taken[N-comp[i]]=true;
}
cout<<poz[2];
for (int i=1; i<=N; i++){
if (!taken[i]){
poz[i]=1;
//cout<<i;
break;
}
}
order.clear();
for (int i=1; i<=N; i++){
cout<<poz[i];
order.push_back(poz[i]);
}
answer(order);
}
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... |