#include "shuffle.h"
#include <vector>
using namespace std;
const int N = 1000, L = 10; /* L = ceil(log2(N)) */
typedef vector<int> vi;
typedef vector<vi> vvi;
int pp[L];
vi solve(int n, int b, int k, int q, int s) {
vi aa(n);
if (s == 3) {
int l = 0, p = 1;
while (p < n)
pp[l++] = p, p *= b;
vi xx(n), idx(p);
for (int i = 0; i < n; i++) {
int d = i % b, x = d;
for (int h = 1; h < l; h++) {
int d_ = (i / pp[h] + d) % b;
x += d_ * pp[h];
}
xx[i] = x, idx[x] = i;
}
vi xx_(n, 0);
for (int h = 0; h < l; h++) {
vvi iii(b);
for (int d = 0; d < b; d++)
iii[d].clear();
for (int i = 0; i < n; i++)
iii[xx[i] / pp[h] % b].push_back(i + 1);
vvi aaa = shuffle(iii);
for (int d = 0; d < b; d++)
for (int g = 0; g < k; g++)
xx_[aaa[d][g] - 1] += d * pp[h];
}
for (int a = 0; a < n; a++)
aa[idx[xx_[a]]] = a + 1;
}
return aa;
}
Compilation message
In file included from shuffle.c:1:
shuffle.h:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.