Submission #232003

#TimeUsernameProblemLanguageResultExecution timeMemory
232003BlerarghList of Unique Integers (FXCUP4_unique)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "unique.h" using namespace std; vector<int> PickUnique(int N){ vector<int> ans(N); int prevL=0, prevR=UniqueCounnt(0,N-1); for (int i=0; i<=N-1; i++){ int newL = UniqueCount(0,i); if (i!=N-1) int newR = UniqueCount(i+1,N-1); if (newL == prevL+1 && newR == prevR+1) ans[i]=1; else ans[i] = 0; prevL = newL; prevR = newR; } return ans; }

Compilation message (stderr)

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:7:22: error: 'UniqueCounnt' was not declared in this scope
   int prevL=0, prevR=UniqueCounnt(0,N-1);
                      ^~~~~~~~~~~~
unique.cpp:7:22: note: suggested alternative: 'UniqueCount'
   int prevL=0, prevR=UniqueCounnt(0,N-1);
                      ^~~~~~~~~~~~
                      UniqueCount
unique.cpp:10:21: warning: unused variable 'newR' [-Wunused-variable]
     if (i!=N-1) int newR = UniqueCount(i+1,N-1);
                     ^~~~
unique.cpp:11:28: error: 'newR' was not declared in this scope
     if (newL == prevL+1 && newR == prevR+1) ans[i]=1;
                            ^~~~
unique.cpp:11:28: note: suggested alternative: 'newL'
     if (newL == prevL+1 && newR == prevR+1) ans[i]=1;
                            ^~~~
                            newL
unique.cpp:15:13: error: 'newR' was not declared in this scope
     prevR = newR;
             ^~~~
unique.cpp:15:13: note: suggested alternative: 'newL'
     prevR = newR;
             ^~~~
             newL