# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
528859 | Alex_tz307 | Gondola (IOI14_gondola) | C++17 | 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.
int valid(int n, int a[]) {
int pos = 0;
for (int i = 0; i < n; ++i) {
if (a[i] == 1) {
pos = i;
break;
}
}
for (int x = 1; x <= n; ++x) {
if (a[pos] != x) {
return 0;
}
pos += 1;
if (pos == n) {
pos = 0;
}
}
return 1;
}