# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
714258 | vjudge1 | Art Collections (BOI22_art) | C++17 | 112 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 <bits/stdc++.h>
#include "art.h"
#define ll long long
#define pii pair<int, int>
using namespace std;
void solve(int N){
int n = N;
vector<int> pos(n + 1, 0);
for (int i = 1; i <= n; i++)
{
for (int j = i + 1; j <= n; j++)
{
vector<int> v = {i, j};
for (int k = 1; k <= n; k++)
{
if(k == i || k == j) continue;
v.emplace_back(k);
}
int p1 = publish(v);
swap(v[0], v[1]);
int p2 = publish(v);
if(p2 < p1){
pos[i]++;
}
else{
pos[j]++;
}
}
}
vector<int> ans(n);
for (int i = 1; i <= n; i++)
{
ans[pos[i]] = 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... |