# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
879587 | vladburac | Art Collections (BOI22_art) | C++17 | 1221 ms | 1596 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;
const int NMAX = 4000;
int cyc[NMAX+1];
int poz[NMAX+1];
void solve( int n ) {
int i, nxt;
vector <int> elem;
for( i = 1; i <= n; i++ )
elem.push_back( i );
i = 1;
do {
cyc[i] = publish( elem );
elem.erase( elem.begin() );
elem.push_back( i );
i++;
} while( i <= n );
for( i = 1; i <= n; i++ ) {
if( i == n )
nxt = 1;
else
nxt = i + 1;
poz[i] = ( cyc[i] - cyc[nxt] + n - 1 ) / 2 + 1;
}
vector <int> ans( n, 0 );
for( i = 1; i <= n; i++ )
ans[poz[i]-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... |