#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] <= n) six = (i-(A[i]-1)+n)%n;
}
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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
488 KB |
Output is correct |
3 |
Correct |
2 ms |
488 KB |
Output is correct |
4 |
Correct |
2 ms |
488 KB |
Output is correct |
5 |
Correct |
2 ms |
488 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
488 KB |
Output is correct |
2 |
Correct |
3 ms |
488 KB |
Output is correct |
3 |
Correct |
2 ms |
676 KB |
Output is correct |
4 |
Correct |
2 ms |
676 KB |
Output is correct |
5 |
Correct |
2 ms |
700 KB |
Output is correct |
6 |
Correct |
20 ms |
2496 KB |
Output is correct |
7 |
Correct |
20 ms |
2496 KB |
Output is correct |
8 |
Correct |
35 ms |
4204 KB |
Output is correct |
9 |
Correct |
14 ms |
4204 KB |
Output is correct |
10 |
Correct |
51 ms |
4964 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4964 KB |
Output is correct |
2 |
Correct |
2 ms |
4964 KB |
Output is correct |
3 |
Correct |
2 ms |
4964 KB |
Output is correct |
4 |
Correct |
2 ms |
4964 KB |
Output is correct |
5 |
Correct |
2 ms |
4964 KB |
Output is correct |
6 |
Correct |
19 ms |
4964 KB |
Output is correct |
7 |
Correct |
16 ms |
4964 KB |
Output is correct |
8 |
Correct |
41 ms |
4964 KB |
Output is correct |
9 |
Correct |
12 ms |
4964 KB |
Output is correct |
10 |
Correct |
61 ms |
4964 KB |
Output is correct |
11 |
Correct |
2 ms |
4964 KB |
Output is correct |
12 |
Correct |
2 ms |
4964 KB |
Output is correct |
13 |
Correct |
25 ms |
4964 KB |
Output is correct |
14 |
Correct |
2 ms |
4964 KB |
Output is correct |
15 |
Correct |
71 ms |
5500 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
5500 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
5500 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
5500 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
5500 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
5500 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
5500 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
5500 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |