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;
/*void Print(vector<int> v) {
for (int w : v) cout << w << " ";
cout << '\n';
}
int Query(vector<int> v) {
Print(v);
int k;
cin >> k;
return k;
}
void Answer(vector<int> v) {
Print(v);
}
void Solve(int n, int m);
int main() {
int n = 4, m = 4;
Solve(n, m);
}*/
int dd[26][10005];
void Solve(int n, int m) {
vector<vector<int>> res(m);
for (int i = 1; i <= n * m; i++) {
int l = 0, r = m, h = m - 1;
while (l <= r) {
int mid = (l + r) / 2;
vector<int> v;
for (int j = 1; j <= n * m; j++) {
if (dd[mid][j] == 1 || i == j) continue;
v.push_back(j);
}
if (Query(v) == m - 2) {
l = mid + 1;
}
else {
h = mid;
r = mid - 1;
}
}
res[h].push_back(i);
dd[h][i] = 1;
}
for (auto w : res) Answer(w);
}
# | 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... |