Submission #67178

# Submission time Handle Problem Language Result Execution time Memory
67178 2018-08-13T13:29:57 Z MKopchev Gondola (IOI14_gondola) C++14
20 / 100
80 ms 5720 KB
#include<bits/stdc++.h>
#include "gondola.h"
using namespace std;
int valid(int n, int inputSeq[])
{
    set<int> uniq={};
    for(int i=0;i<n;i++)
        uniq.insert(inputSeq[i]);
    if(uniq.size()!=n)return 0;
    int mini=0;
    for(int i=1;i<n;i++)
        if(inputSeq[mini]>inputSeq[i])mini=i;
    int ind=(mini+1)%n;
    int value=-1;
    int target=inputSeq[mini];
    while(ind!=mini)
    {
        value=inputSeq[ind];
        target++;
        if(value<target)return 0;
        if(value<=n&&target<=n)
        {
            if(value!=target)return 0;
        }
        ind=(ind+1)%n;
    }
    return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
    return -1;
}
int countReplacement(int n, int inputSeq[])
{
    return -1;
}
/*
int n=6;
int v[]={3, 4, 5, 6, 1, 2} ;
int main()
{
    cout<<valid(n,v)<<endl;
}
*/

Compilation message

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:9:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if(uniq.size()!=n)return 0;
        ~~~~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 3 ms 432 KB Output is correct
4 Correct 3 ms 432 KB Output is correct
5 Correct 3 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 512 KB Output is correct
2 Correct 3 ms 512 KB Output is correct
3 Correct 2 ms 516 KB Output is correct
4 Correct 2 ms 548 KB Output is correct
5 Correct 2 ms 620 KB Output is correct
6 Correct 23 ms 2412 KB Output is correct
7 Correct 56 ms 4076 KB Output is correct
8 Correct 35 ms 4208 KB Output is correct
9 Correct 11 ms 4208 KB Output is correct
10 Correct 37 ms 4844 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 4844 KB Output is correct
2 Correct 3 ms 4844 KB Output is correct
3 Correct 3 ms 4844 KB Output is correct
4 Correct 3 ms 4844 KB Output is correct
5 Correct 3 ms 4844 KB Output is correct
6 Correct 20 ms 4844 KB Output is correct
7 Correct 74 ms 4844 KB Output is correct
8 Correct 35 ms 4844 KB Output is correct
9 Correct 15 ms 4844 KB Output is correct
10 Correct 40 ms 4844 KB Output is correct
11 Correct 3 ms 4844 KB Output is correct
12 Correct 2 ms 4844 KB Output is correct
13 Correct 24 ms 4844 KB Output is correct
14 Correct 3 ms 4844 KB Output is correct
15 Correct 80 ms 5720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5720 KB Integer -1 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 5720 KB Integer -1 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 5720 KB Integer -1 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5720 KB Integer -1 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5720 KB Integer -1 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5720 KB Integer -1 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 5720 KB Integer -1 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -