# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1066370 | sammyuri | Super Dango Maker (JOI22_dango3) | C++17 | 217 ms | 688 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;
void Solve(int N, int M) {
mt19937 rng(1000);
vector<int> mapping(N * M);
for (int i = 0; i < N * M; i ++)
mapping[i] = i + 1;
shuffle(mapping.begin(), mapping.end(), rng);
vector<int> active;
for (int i = 0; i < N * M; i ++) {
active.push_back(mapping[i]);
int xx = Query(active);
if (xx == 0)
continue;
// remove pointless ones
vector<int> cur = active;
vector<int> secure;
vector<int> wasted;
int ii = 0;
while (cur.size() - ii + secure.size() > N) {
vector<int> test = secure;
for (int j = ii + 1; j < active.size(); j ++)
test.push_back(active[j]);
int ans = Query(test);
if (ans == 0)
secure.push_back(active[ii]);
else
wasted.push_back(active[ii]);
ii ++;
}
for (int j = ii; j < active.size(); j ++)
secure.push_back(active[j]);
Answer(secure);
active = wasted;
}
}
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... |