제출 #231271

#제출 시각아이디문제언어결과실행 시간메모리
231271origami100List of Unique Integers (FXCUP4_unique)C++17
컴파일 에러
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;
}

컴파일 시 표준 에러 (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--){
              ^