# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
118828 |
2019-06-19T22:49:29 Z |
ly20 |
Gondola (IOI14_gondola) |
C++17 |
|
44 ms |
4728 KB |
#include<bits/stdc++.h>
using namespace std;
const int INF=1123456789;
map<int,int> vld;
#include "gondola.h"
int valid(int n,int seq[])
{
int mn=INF,at=INF,at2=INF;
int st=0;
bool vl=1;
for(int i=0;i<n;i++)
{
if(vld[seq[i]]>0)vl=0;
vld[seq[i]]++;
if(st==0)
{
if(seq[i]>n)continue;
if(seq[i]<at && at==INF)
{
at=seq[i];mn=seq[i];
}
else if(seq[i]<at)
{
at2=seq[i];st=1;
if(at2>mn)vl=0;
}
else at=seq[i];
}
else
{
if(seq[i]>n)continue;
if(seq[i]<at2 || seq[i]>mn || seq[i]>at)vl=0;
at2=seq[i];
}
}
return vl;
}
int replacement(int n,int gondolaseq[],int replacementseq[])
{
return 0;
}
int countReplacement(int n,int inputSeq[])
{
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Correct |
2 ms |
256 KB |
Output is correct |
5 |
Correct |
2 ms |
256 KB |
Output is correct |
6 |
Correct |
17 ms |
2304 KB |
Output is correct |
7 |
Correct |
44 ms |
3704 KB |
Output is correct |
8 |
Correct |
29 ms |
3960 KB |
Output is correct |
9 |
Correct |
10 ms |
1664 KB |
Output is correct |
10 |
Correct |
42 ms |
4728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
6 |
Correct |
16 ms |
2304 KB |
Output is correct |
7 |
Correct |
41 ms |
3704 KB |
Output is correct |
8 |
Correct |
30 ms |
3968 KB |
Output is correct |
9 |
Correct |
11 ms |
1536 KB |
Output is correct |
10 |
Correct |
40 ms |
4600 KB |
Output is correct |
11 |
Correct |
2 ms |
256 KB |
Output is correct |
12 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
13 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |