Submission #974578

# Submission time Handle Problem Language Result Execution time Memory
974578 2024-05-03T13:25:58 Z hariaakas646 Gondola (IOI14_gondola) C++14
Compilation error
0 ms 0 KB
#include "gondola.h"

int valid(int n, int inputSeq[])
{
  pii mi = mp(2e9, 1e9);
  frange(i, n) {
    mi = min(mi, mp(inputSeq[i], i));
  }
  if(mi.f > n) return 1;
  int v = mi.f;
  forr(i, mi.s+1, n) {
    if(inputSeq[i] <= n) {
      if(inputSeq[i] > v) v = inputSeq[i];
      else return 0;
    }
  }
  forr(i, 0, mi.s) {
    if(inputSeq[i] <= n) {
      if(inputSeq[i] > v) v = inputSeq[i];
      else 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:5:3: error: 'pii' was not declared in this scope
    5 |   pii mi = mp(2e9, 1e9);
      |   ^~~
gondola.cpp:6:10: error: 'i' was not declared in this scope
    6 |   frange(i, n) {
      |          ^
gondola.cpp:6:3: error: 'frange' was not declared in this scope
    6 |   frange(i, n) {
      |   ^~~~~~
gondola.cpp:9:6: error: 'mi' was not declared in this scope
    9 |   if(mi.f > n) return 1;
      |      ^~
gondola.cpp:10:11: error: 'mi' was not declared in this scope
   10 |   int v = mi.f;
      |           ^~
gondola.cpp:11:3: error: 'forr' was not declared in this scope
   11 |   forr(i, mi.s+1, n) {
      |   ^~~~
gondola.cpp:10:7: warning: unused variable 'v' [-Wunused-variable]
   10 |   int v = mi.f;
      |       ^