Submission #955086

# Submission time Handle Problem Language Result Execution time Memory
955086 2024-03-29T10:59:03 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;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[]){
	return 1;
}
int countReplacement(int n, int inputSeq[]){
	if (!valid(n,inputSeq))return 0;
	return 1;
}

Compilation message

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