# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
72864 |
2018-08-27T06:12:12 Z |
nvmdava |
Gondola (IOI14_gondola) |
C++17 |
|
83 ms |
5816 KB |
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
int ord[100001];
map<int, int> in;
int valid(int n, int inputSeq[])
{
int i;
for(i = 0; i < n; i++){
if(inputSeq[i] <= n) break;
}
int k = inputSeq[i] - 1;
for(int j = 0; j < n; j++){
ord[(k + j) % n] = inputSeq[(i + j) % n];
if(in[inputSeq[(i + j) % n]]) return 0;
in[inputSeq[(i + j) % n]] = 1;
}
if(i == n) return 1;
for(i = 0; i < n; i++){
if((ord[i] != i + 1 && ord[i] <= n) || ord[i] < 1) 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 |
3 ms |
396 KB |
Output is correct |
4 |
Correct |
3 ms |
472 KB |
Output is correct |
5 |
Correct |
2 ms |
548 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
548 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
2 ms |
612 KB |
Output is correct |
4 |
Correct |
2 ms |
620 KB |
Output is correct |
5 |
Correct |
2 ms |
620 KB |
Output is correct |
6 |
Correct |
23 ms |
2596 KB |
Output is correct |
7 |
Correct |
17 ms |
2596 KB |
Output is correct |
8 |
Correct |
42 ms |
4488 KB |
Output is correct |
9 |
Correct |
13 ms |
4488 KB |
Output is correct |
10 |
Correct |
53 ms |
5100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
5100 KB |
Output is correct |
2 |
Correct |
2 ms |
5100 KB |
Output is correct |
3 |
Correct |
3 ms |
5100 KB |
Output is correct |
4 |
Correct |
3 ms |
5100 KB |
Output is correct |
5 |
Correct |
3 ms |
5100 KB |
Output is correct |
6 |
Correct |
23 ms |
5100 KB |
Output is correct |
7 |
Correct |
21 ms |
5100 KB |
Output is correct |
8 |
Correct |
41 ms |
5100 KB |
Output is correct |
9 |
Correct |
15 ms |
5100 KB |
Output is correct |
10 |
Correct |
51 ms |
5100 KB |
Output is correct |
11 |
Correct |
3 ms |
5100 KB |
Output is correct |
12 |
Correct |
3 ms |
5100 KB |
Output is correct |
13 |
Correct |
25 ms |
5100 KB |
Output is correct |
14 |
Correct |
3 ms |
5100 KB |
Output is correct |
15 |
Correct |
83 ms |
5816 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
5816 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
5816 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
5816 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
5816 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
5816 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
5816 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
5816 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |