# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
392149 | rainboy | 곤돌라 (IOI14_gondola) | C11 | 0 ms | 0 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 "gondola.h"
#define A 250000
int valid(int n, int aa[]) {
static char used[A + 1];
int i, j;
for (i = 0; i < n; i++) {
if (used[aa[i]])
return 0;
used[aa[i]] = 1;
}
for (i = 0; i < n; i++)
if (aa[i] <= n) {
for (j = 0; j < n; j++)
if (aa[(i + j) % n] <= n && aa[(i + j) % n] != (aa[i] - 1 + j) % n + 1)
return 0;
return 1;
}
return 1;
}
int replacement(int n, int aa[], int bb[]) {
return -2;
}
int countReplacement(int n, int aa[]) {
return -3;
}