Submission #1017555

# Submission time Handle Problem Language Result Execution time Memory
1017555 2024-07-09T08:48:23 Z vivkostov Gondola (IOI14_gondola) C++14
20 / 100
9 ms 3668 KB
#include<bits/stdc++.h>
#define endl '\n'
#include "gondola.h"
using namespace std;
void speed()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
int n,a[200005],used[1000005];
int valid(int n,int seq[])
{
    int br=0;
    for(int i=1;i<=n;i++)
    {
        a[i]=seq[i-1];
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i]<=n)
        {
            if(!br)br=a[i];
            else
            {
                if(a[i]!=br)
                {
                    return 0;
                }
            }
        }
        if(used[a[i]])
        {
            return 0;
        }
        used[a[i]]=1;
        if(br)br++;
        if(br>n)br=1;
    }
    for(int i=n+2;i<=250000;i++)
    {
        if(used[i]&&!used[i-1])
        {
            return 0;
        }
    }
    return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
    return 0;
}
int countReplacement(int n, int inputSeq[])
{
    return 0;
}

/*int main()
{
    speed();
    read();
    return 0;
}
*/
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Correct 1 ms 2392 KB Output is correct
3 Correct 1 ms 2392 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 3 ms 2908 KB Output is correct
7 Correct 9 ms 3420 KB Output is correct
8 Correct 5 ms 3420 KB Output is correct
9 Correct 2 ms 2652 KB Output is correct
10 Correct 6 ms 3380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 3 ms 2908 KB Output is correct
7 Correct 6 ms 3156 KB Output is correct
8 Correct 5 ms 3668 KB Output is correct
9 Correct 2 ms 2652 KB Output is correct
10 Correct 6 ms 3456 KB Output is correct
11 Correct 1 ms 2392 KB Output is correct
12 Correct 1 ms 2396 KB Output is correct
13 Correct 3 ms 3164 KB Output is correct
14 Correct 0 ms 2396 KB Output is correct
15 Correct 6 ms 3164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -