Submission #118816

# Submission time Handle Problem Language Result Execution time Memory
118816 2019-06-19T22:30:41 Z ly20 Gondola (IOI14_gondola) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
const int INF=1123456789;
#include "gondola.h"
bool valid(int n,vector<int> seq)
{
	int mn=INF,at=INF,at2=INF;
	int st=0;
	bool vl=1;
	for(int i=0;i<n;i++)
	{
		if(st==0)
		{
			if(seq[i]<at && seq[i]<=n && at==INF)
			{
				at=seq[i];mn=seq[i];
			}
			else if(seq[i]<at && seq[i]<=n)
			{
				at2=seq[i];st=1;
			}
			else at=seq[i];
		}
		else
		{
			if(seq[i]>n)continue;
			if(seq[i]<at2 || seq[i]>mn || seq[i]>at)vl=0;
			at2=seq[i];
		}
	}	
	return vl;
}
int replacement(int n, vector<int> gondolaseq,vector<int> replacementseq)
{
}
int countReplacement(int n,vector<int> inputSeq)
{
}

Compilation message

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