Submission #896765

# Submission time Handle Problem Language Result Execution time Memory
896765 2024-01-02T05:46:49 Z LCJLY Gondola (IOI14_gondola) C++14
Compilation error
0 ms 0 KB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;

int valid(int n, int arr[]){
	unordered_set<int>se;
	bool amos=true;
	deque<int>d;
	int mini=INT_MAX;
	for(int x=0;x<n;x++){
		if(se.find(arr[x])!=se.end()) amos=false;
		se.insert(arr[x]);
		if(arr[x]<=n){
			d.push_back(arr[x]);
			mini=min(mini,arr[x]);
		}	
	}
	
	int ptr=1;
	for(int x=1;x<=n;x++){
		if(se.find(x)==se.end()){
			if(se.find(ptr+n)==se.end()) amos=false;
			ptr++;
		}
	}
	
	if(!d.empty()){
		while(d.front()!=mini){
			d.push_front(d.back());
			d.pop_back();
		}
		
		for(int x=1;x<(int)d.size();x++){
			if(d[x]<d[x-1]) amos=false;
		}
	}
	
	return amos;
}

Compilation message

/usr/bin/ld: /tmp/ccc99JGV.o: in function `main':
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