Submission #231271

#TimeUsernameProblemLanguageResultExecution timeMemory
231271origami100List 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> res; for(int i = 0; i < n; i++){ res.push_back(1); } int cur, prev = 1; for(int i = 1; i < n; i++){ cur = UniqueCount(0, i); if(cur <= prev){ res[i] = 0; } } prev = 1; for(int i = n - 2; i >= 0; i--){ cur = UniqueCount(i, n - 1); if(cur <= prev){ res[i] = 0; } } return res; }

Compilation message (stderr)

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:6:21: error: 'n' was not declared in this scope
  for(int i = 0; i < n; i++){
                     ^
unique.cpp:10:21: error: 'n' was not declared in this scope
  for(int i = 1; i < n; i++){
                     ^
unique.cpp:17:14: error: 'n' was not declared in this scope
  for(int i = n - 2; i >= 0; i--){
              ^