# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
704904 | piOOE | Super Dango Maker (JOI22_dango3) | C++17 | 1639 ms | 740 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 "dango3.h"
#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(228);
void Solve(int n, int m) {
const int N = n * m;
vector<int> ord(N);
iota(ord.begin(), ord.end(), 1);
shuffle(ord.begin(), ord.end(), rnd);
set<int> st;
for (int x : ord) {
st.insert(x);
if (Query(vector(st.begin(), st.end())) == 1) {
vector<int> stick{x};
vector<int> consider(st.begin(), st.end());
consider.erase(find(consider.begin(), consider.end(), x));
set<int> save;
for (int y : consider) {
st.erase(y);
if (stick.size() < n && Query(vector(st.begin(), st.end())) == 0) {
stick.push_back(y);
st.insert(y);
} else {
save.insert(y);
}
}
Answer(stick);
swap(st, save);
}
}
}
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... |