# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
341064 | mohamedsobhi777 | Gondola (IOI14_gondola) | C++14 | 12 ms | 620 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 <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#include "gondola.h"
int valid(int n, int inputSeq[])
{
map<int, int> mp;
int Max = 0;
if (*min_element(inputSeq, inputSeq + n) > n)
return 1;
for (int i = 0; i < n; ++i)
inputSeq[i]--;
auto check1 = [&](int i) -> bool {
bool ret1 = 1, ret2 = 1;
for (int j = 1; j < n; ++j)
{
int nxt = (i + j) % n;
if (inputSeq[nxt] >= n)
continue;
if (inputSeq[nxt] != (inputSeq[i] + j) % n)
ret1 = 0;
if (inputSeq[nxt] != (inputSeq[i] - j + n) % n)
ret2 = 0;
}
return ret1 | ret2;
};
for (int i = 0; i < n; ++i)
{
if (inputSeq[i] < n)
return check1(i);
}
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
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... |
# | 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... |