#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int n, m;
} // namespace
int my_query(vector<int> &V){
vector<int> Q;
int pt = 0;
for (int i=1;i<=n*m;i++){
if (pt<(int)V.size() && V[pt]==i){pt++; continue;}
Q.push_back(i);
}
return m - Query(Q);
}
void dnc(vector<int> &V){
assert(V.size()%m==0);
int need = V.size() / m;
if (need==1){
Answer(V);
return;
}
vector<int> V1, V2;
for (auto &x:V){
V1.push_back(x);
if (my_query(V1) > need/2){
V1.pop_back();
V2.push_back(x);
}
}
dnc(V1); dnc(V2);
}
void Solve(int N, int M) {
n = N, m = M;
vector<int> V;
for (int i=1;i<=n*m;i++){
V.push_back(i);
}
dnc(V);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
340 KB |
Output is correct |
5 |
Correct |
0 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
283 ms |
508 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1408 ms |
748 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2808 ms |
684 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |