# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
595629 | vh50 | Art Collections (BOI22_art) | C++17 | 26 ms | 216 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 <bits/stdc++.h>
#include "art.h"
using namespace std;
void solve(int N)
{
vector <int> v, f;
for(int i = 1; i <= N; i++) {v.push_back(i); f.push_back(0);}
if(N <= 6)
{
while(publish(v))
{
next_permutation(v.begin(), v.end());
}
answer(v);
}
else if(N <= 40)
{
for(int i = 0; i < N; i++)
for(int j = i + 1; j < N; j++)
{
swap(v[0], v[i]);
swap(v[1], v[j]);
int k = publish(v);
swap(v[0], v[1]);
if(k - publish(v) == 1) f[i]++;
else f[j]++;
swap(v[0], v[1]);
swap(v[1], v[j]);
swap(v[0], v[i]);
}
for(int i = 0; i < N; i++)
{
v[f[i]] = i + 1;
}
answer(v);
}
}
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... |