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>
#include "dango3.h"
using namespace std;
vector<int> ans, v2, x;
bool mark[100005];
vector<int> dango[100];
void Solve(int n, int m) {
for (int i = 1; i <= n * m; i++) {
int l = -1, r = m - 1, mid;
while(l + 1 != r) {
mid = (l + r) / 2;
for (int j = 1; j <= n * m; j++) mark[j] = true;
for (int i = 0; i <= mid; i++) {
for (int j: dango[i]) mark[j] = false;
}
mark[i] = false;
x.clear();
for (int j = 1; j <= n * m; j++) if(mark[j]) x.push_back(j);
int dm = Query(x);
if(dm == m - mid - 2) l = mid;
else r = mid;
}
dango[r].push_back(i);
}
for (int i = 0; i < m; i++) Answer(dango[i]);
}
# | 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... |