# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
873210 | rainboy | Shuffle (NOI19_shuffle) | C++17 | 2 ms | 2652 KiB |
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 "shuffle.h"
#include <cstring>
#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], xx[N], idx[N * N], xx_[N];
int uu[N], vv[N];
vi solve(int n, int m, int k, int q, int s) {
vvi iii(m), aaa;
vi aa(n);
if (s == 3) {
int l = 0, p = 1;
while (p < n)
pp[l++] = p, p *= m;
for (int i = 0; i < n; i++) {
int d = i % m, x = d;
for (int h = 1; h < l; h++) {
int d_ = (i / pp[h] + d) % m;
x += d_ * pp[h];
}
idx[xx[i] = x] = i;
}
memset(xx_, 0, n * sizeof *xx_);
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |