/**
_ _ __ _ _ _ _ _ _
|a ||t ||o d | |o |
| __ _| | _ | __| _ |
| __ |/_ | __ /__\ / _\|
**/
#include <bits/stdc++.h>
#include "dango3.h"
using namespace std;
typedef long long ll;
int Query (const vector <int> &x);
void Answer (const vector <int> &a);
int N, M;
void solve (vector <int> v) {
int k = (int) v.size();
int m = (int) v.size() / N;
if (m == 1) {
for (int &i : v) {
i++;
}
Answer(v);
return;
}
m /= 2;
bool in[k]; fill(in, in + k, true);
for (int i : v) {
in[i] = false;
vector <int> x;
for (int j : v) {
if (in[j] == true) {
x.push_back(j + 1);
}
}
if (Query(x) < m) {
in[i] = true;
}
}
vector <int> split[2];
for (int i : v) {
split[in[i]].push_back(i);
}
solve(split[0]);
solve(split[1]);
}
void Solve (int _N, int _M) {
N = _N; M = _M;
vector <int> v(N * M);
iota(v.begin(), v.end(), 0);
solve(v);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
15192 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
348 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
78 ms |
852 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
239 ms |
604 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |