# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
796727 | TheSahib | Art Collections (BOI22_art) | C++17 | 759 ms | 31984 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>
using namespace std;
vector<int> v;
int x = 0;
map<vector<int>, int> mp;
int ask(vector<int>& v){
if(mp.find(v) != mp.end()) return mp[v];
return mp[v] = publish(v);
}
bool comp(int a, int b){
swap(v[a - 1], v[b - 1]);
int y = ask(v);
swap(v[a - 1], v[b - 1]);
if(a < b){
return x < y;
}
else{
return x > y;
}
}
void solve(int N) {
v.resize(N);
iota(v.begin(), v.end(), 1);
x = ask(v);
vector<int> ans(N);
iota(ans.begin(), ans.end(), 1);
stable_sort(ans.begin(), ans.end(), comp);
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... |