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 <vector>
#include <cassert>
using namespace std;
namespace {
}
void Solve(int n, int m) {
vector<bool> used(n*m);
for (int t = 0; t < m; t++) {
vector<int> here;
for (int i = 0; i < n*m; i++) if (!used[i]) {
here.push_back(i + 1);
}
for (int i = 0; i < (int)here.size(); i++) {
int orig = here[i];
here.erase(here.begin() + i);
int res = Query(here);
if (res == 0) here.insert(here.begin() + i, orig);
else i--;
}
Answer(here);
for (int x : here) used[x-1] = 1;
}
}
# | 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... |