#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
int valid(int n, int inputSeq[])
{
bool lol = 1;
int ind = -1;
for( int i = 0 ; i < n ; i++ ){
if( inputSeq[i] <= n ){
lol = 0;
ind = i;
}
}
if( lol == 1 ){
return 1;
}
int ct[n + 5];
int nn = n + inputSeq[ind] - 1 - ind;
for( int i = 0 ; i < n ; i++ ){
ct[(nn + i) % n] = inputSeq[i];
}
for( int i = 0 ; i < n ; i++ ){
if( ct[i] <= n ){
if( i != ct[i] - 1 ){
return 0;
}
}
}
return 1;
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 |
248 KB |
Output is correct |
2 |
Correct |
2 ms |
488 KB |
Output is correct |
3 |
Correct |
3 ms |
488 KB |
Output is correct |
4 |
Correct |
3 ms |
572 KB |
Output is correct |
5 |
Correct |
3 ms |
576 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
628 KB |
Output is correct |
2 |
Correct |
3 ms |
632 KB |
Output is correct |
3 |
Correct |
3 ms |
640 KB |
Output is correct |
4 |
Correct |
3 ms |
644 KB |
Output is correct |
5 |
Correct |
3 ms |
688 KB |
Output is correct |
6 |
Correct |
10 ms |
1208 KB |
Output is correct |
7 |
Correct |
16 ms |
2192 KB |
Output is correct |
8 |
Correct |
13 ms |
2344 KB |
Output is correct |
9 |
Correct |
6 ms |
2344 KB |
Output is correct |
10 |
Correct |
15 ms |
3036 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3036 KB |
Output is correct |
2 |
Correct |
3 ms |
3036 KB |
Output is correct |
3 |
Correct |
3 ms |
3036 KB |
Output is correct |
4 |
Correct |
3 ms |
3036 KB |
Output is correct |
5 |
Correct |
3 ms |
3036 KB |
Output is correct |
6 |
Correct |
9 ms |
3036 KB |
Output is correct |
7 |
Correct |
17 ms |
3884 KB |
Output is correct |
8 |
Correct |
14 ms |
4148 KB |
Output is correct |
9 |
Correct |
7 ms |
4148 KB |
Output is correct |
10 |
Correct |
16 ms |
4808 KB |
Output is correct |
11 |
Incorrect |
3 ms |
4808 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
4808 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4808 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4808 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4808 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4808 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4808 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
4808 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |