Submission #238428

#TimeUsernameProblemLanguageResultExecution timeMemory
238428lakshith_Gondola (IOI14_gondola)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "gondola.h" using namespace std; set<int> visited; int valid(int n,int input[]){ for(int i=0;i<n;i++) if(visited.find(input[i])!=visited.end()) return 0; else visited.insert(input[i]); int start = -1; for(int i=0;i<n;i++)if(input[i]<=n){ start = i; break; } if(start==-1)return 1; int next = input[start]; int pos = start; for(int i=0;i<n;i++){ if(input[pos]<=n&&input[pos]!=next)return 0; pos++; if(pos>=n)pos=0; next++; if(next>n)next=1; } return 1; } int replacement(int n, int gondolaSeq[], int replacementSeq[]){ // int MAX = 0; // for(int i=0;i<n;i++){ // visited[gondolaSeq[i]]=true; // MAX = max(MAX,gondolaSeq[i]); // } // int l = 0; // for(int i=1;i<MAX;i++) // if(!visited[i])replacementSeq[l++]=i; // return l; // } // int countReplacement(int n, int inputSeq[]){ // return 0; } // int main(){ // while(true){ // int n; // cin >> n; // int arr[n]; // int temp[n]; // for(int i=0;i<n;i++)cin >> arr[i]; // cout << valid(n,arr) << "\n"; // } // }

Compilation message (stderr)

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