#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
int query(vector<bool> a){
vector<int> res;
for (int i=0; i<a.size(); ++i)if (a[i])res.pb(i+1);
return Query(res);
}
void Solve(int n, int m){
vector<vector<int> > ans(m);
for (int i=0; i<n*m; ++i){
int low=-1, high=m-1;
while (low+1<high){
int mid=(low+high)/2;
vector<bool> temp(n*m, 1);
for (int j=0; j<=mid; ++j)for (auto a:ans[j])temp[a]=0;
temp[i]=0;
if (query(temp)==m-mid-2)low=mid;
else high=mid;
}
ans[high].pb(i);
}
for (int i=0; i<m; ++i){
for (int j=0; j<n; ++j)++ans[i][j];
Answer(ans[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... |