Submission #111747

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

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