#include "gondola.h"
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(x) x.begin(), x.end()
int A[100000];
int cnt[250000];
int valid(int N, int inputSeq[]) {
rep(i, N) A[i] = inputSeq[i]-1;
rep(i, N) cnt[A[i]]++;
rep(i, 250000) if (cnt[i] > 1) return 0;
int base = -1;
rep(i, N) if (A[i] < N) base = (A[i]-i+N)%N;
if (base == -1) return 1;
rep(i, N) if (A[i] < N && (i+base)%N != A[i]) return 0;
return 1;
}
//----------------------
int replacement(int N, int gondolaSeq[], int replacementSeq[]) {
return -2;
}
//----------------------
int countReplacement(int N, int inputSeq[]) {
return -3;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
3848 KB |
Output is correct |
2 |
Correct |
0 ms |
3848 KB |
Output is correct |
3 |
Correct |
0 ms |
3848 KB |
Output is correct |
4 |
Correct |
0 ms |
3848 KB |
Output is correct |
5 |
Correct |
0 ms |
3848 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
3848 KB |
Output is correct |
2 |
Correct |
0 ms |
3848 KB |
Output is correct |
3 |
Correct |
0 ms |
3848 KB |
Output is correct |
4 |
Correct |
0 ms |
3848 KB |
Output is correct |
5 |
Correct |
0 ms |
3848 KB |
Output is correct |
6 |
Correct |
2 ms |
3848 KB |
Output is correct |
7 |
Correct |
16 ms |
3848 KB |
Output is correct |
8 |
Correct |
11 ms |
3848 KB |
Output is correct |
9 |
Correct |
2 ms |
3848 KB |
Output is correct |
10 |
Correct |
5 ms |
3848 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
3848 KB |
Output is correct |
2 |
Correct |
0 ms |
3848 KB |
Output is correct |
3 |
Correct |
0 ms |
3848 KB |
Output is correct |
4 |
Correct |
0 ms |
3848 KB |
Output is correct |
5 |
Correct |
0 ms |
3848 KB |
Output is correct |
6 |
Correct |
7 ms |
3848 KB |
Output is correct |
7 |
Correct |
8 ms |
3848 KB |
Output is correct |
8 |
Correct |
11 ms |
3848 KB |
Output is correct |
9 |
Correct |
3 ms |
3848 KB |
Output is correct |
10 |
Correct |
13 ms |
3848 KB |
Output is correct |
11 |
Correct |
0 ms |
3848 KB |
Output is correct |
12 |
Correct |
0 ms |
3848 KB |
Output is correct |
13 |
Correct |
3 ms |
3848 KB |
Output is correct |
14 |
Correct |
0 ms |
3848 KB |
Output is correct |
15 |
Correct |
10 ms |
3848 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
3848 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
3848 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
3848 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
3848 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
3848 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
3848 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
3848 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |