Submission #230281

# Submission time Handle Problem Language Result Execution time Memory
230281 2020-05-09T13:25:59 Z DanerZein Gondola (IOI14_gondola) C++14
20 / 100
34 ms 5120 KB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
int valid(int n, int inputSeq[])
{
  set<int>s;
  int x=inputSeq[0];
  s.insert(inputSeq[0]);
  for(int i=1;i<n;i++){
    s.insert(inputSeq[i]);
    if(x==n){
      if(inputSeq[i]==1){
	x=1;
      }
      else return 0;
    }
    else{
      if(x==inputSeq[i]-1){
	x=inputSeq[i];
      }
      else return 0;
    }
  }
  if(s.size()!=n) return 0;
  return 1;
}

//----------------------

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
  return -2;
}

//----------------------

int countReplacement(int n, int inputSeq[])
{
  return -3;
}

Compilation message

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:24:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(s.size()!=n) return 0;
      ~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 17 ms 2432 KB Output is correct
7 Correct 18 ms 1152 KB Output is correct
8 Correct 29 ms 4352 KB Output is correct
9 Correct 11 ms 1664 KB Output is correct
10 Correct 33 ms 4988 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 17 ms 2432 KB Output is correct
7 Correct 18 ms 1152 KB Output is correct
8 Correct 29 ms 4352 KB Output is correct
9 Correct 12 ms 1664 KB Output is correct
10 Correct 34 ms 5120 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 11 ms 768 KB Output is correct
14 Correct 5 ms 384 KB Output is correct
15 Correct 18 ms 1152 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -