# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
701429 | lovrot | Art Collections (BOI22_art) | C++17 | 1506 ms | 540 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 <cstdio>
#include <vector>
#include "art.h"
#define X first
#define Y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 4000;
int ans[N];
vector<int> v;
void solve(int n) {
for(int i = 1; i <= n; i++) v.pb(i);
int c = publish(v);
for(int i = 1; i < n; i++) {
int f = v[0];
v.erase(v.begin());
v.pb(f);
int c2 = publish(v);
int x = (c - c2 + 1 + n) / 2;
ans[x] = i;
c = c2;
}
vector<int> sol;
for(int i = 1; i <= n; i++) {
if(ans[i]) sol.pb(ans[i]);
else sol.pb(n);
}
answer(sol);
return;
}
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... |