#include "gondola.h"
#include <bits/stdc++.h>
#define fr first
#define sc second
#define mk make_pair
#define pb emplace_back
#define all(s) s.begin(), s.end()
const int N = 1e5 + 5;
int mp[N];
int valid(int n, int ar[])
{
for (int i = 1; i < n; i++)
{
mp[ar[i]]++;
if (ar[i] < 1 || mp[ ar[i] ] > 1) return 0;
if (ar[i] > n) continue;
if (ar[i - 1] <= n && ar[i - 1] % n + 1 != ar[i]) return 0;
}
if (ar[0] <= n && ar[n - 1] <= n && ar[n - 1] % n + 1 != ar[0]) return 0;
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 |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
428 KB |
Output is correct |
5 |
Correct |
2 ms |
428 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
556 KB |
Output is correct |
2 |
Correct |
3 ms |
556 KB |
Output is correct |
3 |
Correct |
2 ms |
556 KB |
Output is correct |
4 |
Correct |
2 ms |
572 KB |
Output is correct |
5 |
Correct |
2 ms |
576 KB |
Output is correct |
6 |
Correct |
6 ms |
848 KB |
Output is correct |
7 |
Correct |
14 ms |
892 KB |
Output is correct |
8 |
Correct |
11 ms |
1148 KB |
Output is correct |
9 |
Correct |
5 ms |
1148 KB |
Output is correct |
10 |
Correct |
14 ms |
1276 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1276 KB |
Output is correct |
2 |
Correct |
2 ms |
1276 KB |
Output is correct |
3 |
Correct |
2 ms |
1276 KB |
Output is correct |
4 |
Correct |
2 ms |
1276 KB |
Output is correct |
5 |
Correct |
2 ms |
1276 KB |
Output is correct |
6 |
Correct |
7 ms |
1276 KB |
Output is correct |
7 |
Correct |
13 ms |
1276 KB |
Output is correct |
8 |
Correct |
12 ms |
1276 KB |
Output is correct |
9 |
Correct |
5 ms |
1276 KB |
Output is correct |
10 |
Correct |
14 ms |
1276 KB |
Output is correct |
11 |
Correct |
2 ms |
1276 KB |
Output is correct |
12 |
Correct |
2 ms |
1276 KB |
Output is correct |
13 |
Correct |
8 ms |
1532 KB |
Output is correct |
14 |
Correct |
2 ms |
1532 KB |
Output is correct |
15 |
Correct |
14 ms |
1532 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1532 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1532 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1532 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1532 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
1532 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1532 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1532 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |