#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
void Solve(int N, int M) {
vector<bool> used(N * M, 0);
for(int i=0;i<M;i++) {
vector<int> cur(N, -1);
for(int j=0;j<N;j++) {
int l = 0, h = N * M;
while(h - l > 1) {
int m = (l + h) / 2;
vector<int> qry;
for(int k=0;k<m;k++)
if(!used[k])
qry.push_back(k+1);
for(auto k: cur)
if(k-1 >= m)
qry.push_back(k);
if(Query(qry))
h = m;
else
l = m;
}
cur[j] = l+1;
}
Answer(cur);
for(auto j: cur)
used[j-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... |