Submission #102555

# Submission time Handle Problem Language Result Execution time Memory
102555 2019-03-25T21:18:41 Z Leonardo_Paes Gondola (IOI14_gondola) C++11
10 / 100
18 ms 640 KB
#include <bits/stdc++.h>
#include "gondola.h"

using namespace std;

int valid(int n, int vet[]){

    int x=0, cnt=0, ma=n;

    bool ok=true;

    for(int i=0; i<n; i++){
        if(vet[i]>n)cnt++, ma=max(ma, vet[i]);
        if(vet[i]>n or vet[i+1]>n){
            continue;
        }
        else{
            if(i==n-1){
                if(vet[0]<vet[i]){
                    if(x==0){
                        x=1;
                    }
                    else{
                        ok=false;
                    }
                }
            }
            else if(vet[i+1]<vet[i]){
                if(x==0){
                    x=1;
                }
                else{
                    ok=false;
                }
            }
        }
    }
    if(cnt != ma-n)ok=false;
    return ok;
}

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 256 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 256 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 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 256 KB Output is correct
6 Correct 6 ms 512 KB Output is correct
7 Correct 12 ms 640 KB Output is correct
8 Correct 9 ms 640 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 12 ms 640 KB Output is correct
# 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 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 10 ms 512 KB Output is correct
7 Correct 18 ms 640 KB Output is correct
8 Correct 9 ms 612 KB Output is correct
9 Correct 6 ms 384 KB Output is correct
10 Correct 11 ms 640 KB Output is correct
11 Incorrect 2 ms 384 KB Output isn't correct
12 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 -
# 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 -