Submission #953587

# Submission time Handle Problem Language Result Execution time Memory
953587 2024-03-26T09:41:39 Z emad234 Gondola (IOI14_gondola) C++17
Compilation error
0 ms 0 KB
#include "gondola.h"
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define pii pair<ll, ll>
const ll mod = 1e9 + 7;
const ll mxN = 1e6 + 5;
using namespace std;
int valid(int n, int inputSeq[])
{
  int st = 0;
  int val = 1;
  for (int i = 0; i < n; i++)
  {
    if (inputSeq[i] <= n)
    {
      st = i;
      val = inputSeq[i];
      break;
    }
  }
  int og = st;
  while (1)
  {
    st++;
    val++;
    if (st >= n)
      st = 0;
    if (val > n)
      val = 1;
    if (st == og)
      break;
    if (inputSeq[st] != val && inputSeq[st] <= 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 replacement(int, int*, int*)':
gondola.cpp:44:12: error: expected ';' before '}' token
   44 |   return -2
      |            ^
      |            ;
   45 | }
      | ~