Submission #1026274

# Submission time Handle Problem Language Result Execution time Memory
1026274 2024-07-17T18:46:06 Z MarwenElarbi Gondola (IOI14_gondola) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
//#include "gondola.h"
using namespace std;
#define pb push_back
#define se second
#define fi first
const int nax=5e5+5;
const int MOD=1e9+7;
vector<pair<int,int>> tab;
int valid(int n, int inputSeq[])
{
    for (int i = 0; i < n; ++i)
    {
        if(inputSeq[i]<=n){
            tab.pb({inputSeq[i],i});
        }
    }
    bool test=true;
    bool nabba=false;
    for (int i = 1; i < tab.size(); ++i)
    {
        if(tab[i].fi<tab[i-1].fi){
            if(nabba) test=false;
            nabba=true;
            if(tab[i].fi>tab[i].se-tab[i-1].se) test=false;
        }
    }
    return test;
}

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

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:20:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for (int i = 1; i < tab.size(); ++i)
      |                     ~~^~~~~~~~~~~~
/usr/bin/ld: /tmp/ccn7Oitz.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