Submission #955085

# Submission time Handle Problem Language Result Execution time Memory
955085 2024-03-29T10:58:43 Z 4QT0R Gondola (IOI14_gondola) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>

int valid(int n, int inputSeq[]){
	set<int> s(inputSeq,inputSeq+n);
	if ((int)s.size()<n)return 0;
	pii mn={n+1,-1};
	for (int i = 0; i<n; i++){
		if (inputSeq[i]<mn.first)mn={inputSeq[i],i};
	}
	int cur=mn.first;
	for (int i = mn.second+1; i<n; i++){
		if (inputSeq[i]<=n && inputSeq[i]!=++cur)return 0;
	}
	for (int i = 0; ++cur<=n; i++){
		if (inputSeq[i]<=n && inputSeq[i]!=cur)return 0;
	}
	return 1;
}

Compilation message

/usr/bin/ld: /tmp/cc3YIyXI.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