#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define all(x) x.begin(),x.end()
#include "dango3.h"
namespace {
int variable_example = 1;
} // namespace
void Solve(int N, int M) {
int n,m;
n = N;
m = M;
vector<vector<int>> ans;
vector<int> fq;
ans.resize(m);
fq.resize(n*m+1,0);
for(int i = 1; i <= n*m; i++) {
int l = 0;
int r = m-1;
while(l < r) {
int mid = (l+r)>>1;
for(int j = l; j <= mid; j++) {
for(auto x : ans[j]) fq[x]++;
}
vector<int> vc;
for(int j = 1; j <= n*m; j++) {
if(fq[j] == 0 && i != j) vc.pb(j);
}
for(int j = l; j <= mid; j++) {
for(auto x : ans[j]) fq[x]--;
}
int apmx = Query(vc);
if(apmx <= mid-l+1) {
r = mid;
}
else {
l = mid+1;
}
}
ans[l].pb(i);
}
for(int i = 0; i < m; i++) {
Answer(ans[i]);
}
return;
std::vector<int> x(3);
x[0] = 1;
x[1] = 2;
x[2] = 3;
variable_example = Query(x);
for (int i = 0; i < M; i++) {
std::vector<int> a(N);
for (int j = 0; j < N; j++) {
a[j] = N * i + j + 1;
}
Answer(a);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
340 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
26 ms |
368 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
825 ms |
448 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3057 ms |
704 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |