#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
int valid(int n, int A[])
{
set<int> seen;
int six = -1;
for (int i = 0; i < n; ++i) {
if (seen.count(A[i])) return 0;
seen.insert(A[i]);
if (A[i] == 1) six = i;
}
if (six == -1) return 1;
for (int i = 0; i < n; ++i) {
int j = (six+i)%n;
if (A[j] <= n && A[j] != i+1)
return false;
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
380 KB |
Output is correct |
2 |
Correct |
3 ms |
380 KB |
Output is correct |
3 |
Correct |
3 ms |
420 KB |
Output is correct |
4 |
Correct |
3 ms |
728 KB |
Output is correct |
5 |
Correct |
3 ms |
728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
728 KB |
Output is correct |
2 |
Correct |
3 ms |
728 KB |
Output is correct |
3 |
Correct |
2 ms |
728 KB |
Output is correct |
4 |
Correct |
2 ms |
728 KB |
Output is correct |
5 |
Correct |
2 ms |
780 KB |
Output is correct |
6 |
Correct |
21 ms |
2724 KB |
Output is correct |
7 |
Correct |
17 ms |
2724 KB |
Output is correct |
8 |
Correct |
49 ms |
5332 KB |
Output is correct |
9 |
Correct |
15 ms |
5332 KB |
Output is correct |
10 |
Correct |
49 ms |
6632 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6632 KB |
Output is correct |
2 |
Correct |
3 ms |
6632 KB |
Output is correct |
3 |
Correct |
2 ms |
6632 KB |
Output is correct |
4 |
Correct |
3 ms |
6632 KB |
Output is correct |
5 |
Correct |
3 ms |
6632 KB |
Output is correct |
6 |
Correct |
21 ms |
6632 KB |
Output is correct |
7 |
Correct |
17 ms |
6632 KB |
Output is correct |
8 |
Correct |
37 ms |
7084 KB |
Output is correct |
9 |
Correct |
13 ms |
7084 KB |
Output is correct |
10 |
Correct |
53 ms |
8236 KB |
Output is correct |
11 |
Correct |
2 ms |
8236 KB |
Output is correct |
12 |
Correct |
2 ms |
8236 KB |
Output is correct |
13 |
Incorrect |
23 ms |
8236 KB |
Output isn't correct |
14 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
8236 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
8236 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
8236 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
8236 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
8236 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
8236 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
8236 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |