Submission #400977

#TimeUsernameProblemLanguageResultExecution timeMemory
400977Dan4LifeGondola (IOI14_gondola)C++17
Compilation error
0 ms0 KiB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;

int valid(int n, vector<int> a)
{
    int sm = INT_MAX, pos = -1;
    map<int,int> M; M.clear();
    for(auto u : a)
    {
        M[u]++;
        if(M[u]>=2)return 0;
    }
    for(int i = 0; i < n; i++)
        if(sm>a[i] and a[i]<=n)sm=a[i], pos=i;
    if(sm==INT_MAX)return 1;
    int x = n;
    while(x--){
        if(a[pos]==n and a[(pos+1)%n]<=n and a[(pos+1)%n]!=1)return 0;
        else if(a[pos]<n and a[(pos+1)%n]<=n and a[pos]!=a[(pos+1)%n]-1)
            return 0;
        pos++, pos%=n;
    }
    return 1;
}

int replacement(int n, vector<int> gondolaSeq, vector<int> replacementSeq)
{

}

int countReplacement(int n, vector<int> inputSeq)
{

}

Compilation message (stderr)

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