Submission #111745

#TimeUsernameProblemLanguageResultExecution timeMemory
111745imsifileList of Unique Integers (FXCUP4_unique)C++17
Compilation error
0 ms0 KiB
#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 (stderr)

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