Submission #111747

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

int chk[222];

int uc(int l, int r){
	if(l>r) return 0;
	return UniqueCount(l, r);
}

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

Compilation message

unique.cpp: In function 'void PickUnique(int)':
unique.cpp:10: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:14:37: error: 'Report' was not declared in this scope
  for(int i=1; i<=N; i++) if(chk[i]) Report(i);
                                     ^~~~~~
unique.cpp:14:37: note: suggested alternative: 'short'
  for(int i=1; i<=N; i++) if(chk[i]) Report(i);
                                     ^~~~~~
                                     short