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 <bits/stdc++.h>
using namespace std;
void Solve(int n, int m){
vector<int> idx;
for (int i=1; i<=n*m; ++i) idx.push_back(i);
for (int i=0; i<m-1; ++i){
vector<int> cur;
int cr=(int)idx.size()-1;
while ((int)cur.size()!=n){
int l=0, r=cr;
while (l<=r){
int mid=(l+r)>>1;
vector<int> query(idx.begin(), idx.begin()+mid+1);
query.insert(query.end(), cur.begin(), cur.end());
if (Query(query)>=1) r=mid-1;
else l=mid+1;
}
cur.push_back(idx[l]);
cr=l-1;
idx.erase(idx.begin()+l);
}
Answer(cur);
}
Answer(idx);
}
# | 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... |