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>
#define pb push_back
using namespace std;
bool f[400*25 + 5];
vector <int> v[30];
void Solve(int N, int M) {
vector<int> x;
for (int i = 1; i <= N*M; i++){
int l = 1,r = M,res;
while (l <= r){
int mid = (l + r)>>1;
vector <int> f(N*M + 1,1);
for (int j = 1; j <= mid; j++){
for (int x: v[j]) {
f[x] = 0;
}
}
f[i] = 0;
vector <int> vec;
for (int j = 1; j <= N*M; j++)
if (f[j]) vec.pb(j);
int ans = Query(vec);
if (M - ans > mid) {
l = mid + 1;
}else{
r = mid - 1;
res = mid;
}
}
v[res].pb(i);
}
for (int j = 1; j <= M; j++){
Answer(v[j]);
}
}
# | 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... |