# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
579644 | Josia | Art Collections (BOI22_art) | C++17 | 0 ms | 0 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>
using namespace std;
int nPublic;
map<pair<int, int>, bool> dict;
bool compare(int a, int b) {
if (dict.count({a, b})) return dict[{a, b}];
vector<int> ask = {a};
for (int i = 0; i<nPublic; i++) {
if (i+1 == a || i+1 == b) continue;
ask.push_back(i+1);
}
ask.push_back(b);
int AB = publish(ask);
ask[0] = b;
ask[nPublic-1] = a;
int BA = publish(ask);
dict[{a, b}] = AB < BA;