Submission #953586

# Submission time Handle Problem Language Result Execution time Memory
953586 2024-03-26T09:41:15 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[])
{
}

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

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

Compilation message

gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
   44 | }
      | ^
/usr/bin/ld: /tmp/ccCaXWSG.o: in function `main':
grader.cpp:(.text.startup+0xb6): undefined reference to `valid'
/usr/bin/ld: grader.cpp:(.text.startup+0x108): undefined reference to `countReplacement'
/usr/bin/ld: grader.cpp:(.text.startup+0x132): undefined reference to `replacement'
collect2: error: ld returned 1 exit status