Submission #148715

#TimeUsernameProblemLanguageResultExecution timeMemory
148715Fenwick_team (#200)List of Unique Integers (FXCUP4_unique)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> 
using namespace std; 
#define flash ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define debug(x) cerr << " - " << #x << ": " << x << endl;
#define debugs(x, y) cerr << " - " << #x << ": " << x << " " << #y << ": " << y << endl;
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)x.size()
#define ll long long
#define INF 1000000000
#define pb push_back
#define ve vector<ll>
#define dos pair<ll,ll>
#define vedos vector<dos>
struct greateri
{
    template<class T>
    bool operator()(T const &a, T const &b) const { return a > b; }
};
vector<int> PickUnique(int N)
{
	int s = UniqueCount(0,N-1);
	vector<int>ans;
	ans.resize(N);
	for (int i = 0; i < N; ++i)
	{
		ans[i]=0;
	}
	int temp=s;
	ans[N-1]++;
	ans[0]++;
	for (int i = 0; i < N-1; ++i)
	{
		int k = UniqueCount(i+1,N-1);
		if(k!=temp)
		{
			ans[i]++;
		}
		temp=k;
	}
	temp=s;
	for (int i = N-1; i > 0; --i)
	{
		int k = UniqueCount(0,i-1);
		if(k!=temp)
		{
			ans[i]++;
		}
		temp=k;
	}
	for (int i = 0; i < N; ++i)
	{
		ans[i]--;
		ans[i]=max(0,ans[i]);
	}
	return ans;
}

//code the AC sol !
// BS/queue/map

Compilation message (stderr)

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:21:10: error: 'UniqueCount' was not declared in this scope
  int s = UniqueCount(0,N-1);
          ^~~~~~~~~~~