Submission #118818

# Submission time Handle Problem Language Result Execution time Memory
118818 2019-06-19T22:33:55 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,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,int gondolaseq[],int replacementseq[])
{
	return 0;
}
int countReplacement(int n,int inputSeq[])
{
	return 0;
}

Compilation message

gondola.cpp: In function 'bool valid(int, int*)':
gondola.cpp:5:6: error: ambiguating new declaration of 'bool valid(int, int*)'
 bool valid(int n,int seq[])
      ^~~~~
In file included from gondola.cpp:4:0:
gondola.h:8:5: note: old declaration 'int valid(int, int*)'
 int valid(int n, int inputSeq[]);
     ^~~~~