# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
65280 |
2018-08-07T09:43:46 Z |
gnoor |
Gondola (IOI14_gondola) |
C++17 |
|
25 ms |
1812 KB |
#include "gondola.h"
#include <cmath>
#include <cstdio>
bool mark[300100];
int valid(int n, int inputSeq[])
{
int key=-1;
int id=-1;
int cur;
for (int i=0;i<n;i++) {
inputSeq[i]--;
if (mark[inputSeq[i]]) return 0;
mark[inputSeq[i]]=true;
}
for (int i=0;i<n;i++) {
if (inputSeq[i]>=n) continue;
key=inputSeq[i];
id=i;
}
for (int i=0;i<n;i++) {
if (inputSeq[i]>=n) continue;
cur=key+i-id;
cur%=n;
cur+=n;
cur%=n;
if (inputSeq[i]!=cur) 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 |
256 KB |
Output is correct |
2 |
Correct |
3 ms |
480 KB |
Output is correct |
3 |
Correct |
3 ms |
480 KB |
Output is correct |
4 |
Correct |
2 ms |
480 KB |
Output is correct |
5 |
Correct |
3 ms |
480 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
480 KB |
Output is correct |
2 |
Correct |
2 ms |
548 KB |
Output is correct |
3 |
Correct |
3 ms |
548 KB |
Output is correct |
4 |
Correct |
3 ms |
548 KB |
Output is correct |
5 |
Correct |
3 ms |
572 KB |
Output is correct |
6 |
Correct |
10 ms |
708 KB |
Output is correct |
7 |
Correct |
16 ms |
1000 KB |
Output is correct |
8 |
Correct |
13 ms |
1000 KB |
Output is correct |
9 |
Correct |
6 ms |
1000 KB |
Output is correct |
10 |
Correct |
17 ms |
1004 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1004 KB |
Output is correct |
2 |
Correct |
2 ms |
1004 KB |
Output is correct |
3 |
Correct |
2 ms |
1004 KB |
Output is correct |
4 |
Correct |
3 ms |
1004 KB |
Output is correct |
5 |
Correct |
3 ms |
1004 KB |
Output is correct |
6 |
Correct |
9 ms |
1004 KB |
Output is correct |
7 |
Correct |
18 ms |
1004 KB |
Output is correct |
8 |
Correct |
13 ms |
1004 KB |
Output is correct |
9 |
Correct |
6 ms |
1004 KB |
Output is correct |
10 |
Correct |
18 ms |
1004 KB |
Output is correct |
11 |
Correct |
2 ms |
1004 KB |
Output is correct |
12 |
Correct |
3 ms |
1004 KB |
Output is correct |
13 |
Correct |
11 ms |
1168 KB |
Output is correct |
14 |
Correct |
2 ms |
1168 KB |
Output is correct |
15 |
Correct |
25 ms |
1812 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
1812 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1812 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
1812 KB |
Integer -2 violates the range [0, 350000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
1812 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
1812 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1812 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1812 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |