Submission #111745

# Submission time Handle Problem Language Result Execution time Memory
111745 2019-05-16T05:42:37 Z imsifile List of Unique Integers (FXCUP4_unique) C++17
Compilation error
0 ms 0 KB
#include "unique.h"

int pre[222], suf[222];

void PickUnique(int N) {
	for(int i=1; i<=N; i++){
		pre[i]=UniqueCount(1, i);
		suf[i]=UniqueCount(i, N);
	}
	for(int i=1; i<=N; i++){
		if(pre[i]==pre[i-1]+1 && suf[i]==suf[i+1]+1) Report(i);
	}
}

Compilation message

unique.cpp: In function 'void PickUnique(int)':
unique.cpp:5:6: error: ambiguating new declaration of 'void PickUnique(int)'
 void PickUnique(int N) {
      ^~~~~~~~~~
In file included from unique.cpp:1:0:
unique.h:3:18: note: old declaration 'std::vector<int> PickUnique(int)'
 std::vector<int> PickUnique(int N);
                  ^~~~~~~~~~
unique.cpp:11:48: error: 'Report' was not declared in this scope
   if(pre[i]==pre[i-1]+1 && suf[i]==suf[i+1]+1) Report(i);
                                                ^~~~~~
unique.cpp:11:48: note: suggested alternative: 'short'
   if(pre[i]==pre[i-1]+1 && suf[i]==suf[i+1]+1) Report(i);
                                                ^~~~~~
                                                short