# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
721590 | Mr_Husanboy | Art Collections (BOI22_art) | C++17 | 118 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 "art.h"
#include<bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
template<typename T>
int len(T &a){
return a.size();
}
using namespace std;
void solve(int n) {
vector<vector<bool>> comp(n, vector<bool> (n));
for(int i = 1; i <= n; i ++){
for(int j = i + 1; j <= n; j ++){
vector<int> p = {i,j};
for(int k = 1; k <= n; k ++){
if(k != i && k != j) p.push_back(k);
}
int y = publish(p);
swap(p[0], p[1]);
int x = publish(p);
if(y < x){
comp[i - 1][j - 1] = 1;
}else
comp[j - 1][i - 1] = 1;
}
}
vector<int> v(n);
iota(all(v), 1);
sort(all(v), [&](int a, int b){
return comp[a - 1][b - 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... |