# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
389157 | apostoldaniel854 | Gondola (IOI14_gondola) | C++14 | 69 ms | 6020 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 HOME
#ifndef HOME
#include "gondola.h"
#endif // HOME
int valid(int n, int inputSeq[]) {
int mn = 0;
map <int, int> freq;
for (int i = 0; i < n; i++) {
if (inputSeq[i] < inputSeq[mn])
mn = i;
freq[inputSeq[i]]++;
if (freq[inputSeq[i]] > 1) return 0;
}
rotate (inputSeq, inputSeq + mn, inputSeq + n);
int val = inputSeq[0];
for (int i = 0; i < n; i++) {
if (inputSeq[i] <= n) {
if (val != inputSeq[i])
return 0;
}
val++;
}
return 1;
# | 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... |