# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
718005 | fatemetmhr | Art Collections (BOI22_art) | C++17 | 1637 ms | 736 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.
// Be name khoda //
#include "art.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) x.begin(), x.end()
#define pb push_back
#define fi first
#define se second
const int maxn5 = 4e3 + 10;
vector <int> av, tmp;
void solve(int n){
for(int i = 0; i < n; i++)
av.pb(i + 1);
av.shrink_to_fit();
tmp.resize(n);
tmp.shrink_to_fit();
int ans1, ans2;
ans1 = publish(av);
//cout << "here " << n << endl;
for(int i = 1; i < n; i++){
//cout << "ok " << i << endl;
int pt = 1;
tmp[0] = i + 1;
for(int j = 0; j < n; j++) if(av[j] != i + 1)
tmp[pt++] = av[j];
ans2 = publish(tmp);
int x = (i + (ans1 - ans2)) / 2;
int y = i - x;
pt = 0;
for(int j = 0; j < n; j++) if(tmp[j] != i + 1){
if(pt == y)
av[pt++] = (i + 1);
av[pt++] = tmp[j];
}
if(pt == y)
av[pt++] = (i + 1);
ans1 -= x;
}
answer(av);
}
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... |