제출 #148771

#제출 시각아이디문제언어결과실행 시간메모리
148771bitKOIn (#200)List of Unique Integers (FXCUP4_unique)C++17
컴파일 에러
0 ms0 KiB
//#include "unique.h" #include <bits/stdc++.h> #define PI 3.1415926535897932384626 using namespace std; struct vec { long double x,y; bool operator ==(const vec &a) const{ return x==a.x&&y==a.y; } bool operator <(const vec &a) const{ if(a.x!=x) return x<a.x; return y<a.y; } vec operator +(const vec &a) const{ return {x+a.x,y+a.y}; } vec operator *(const long double &a) const{ return {x*a,y*a}; } vec operator -(const vec &a) const{ return {x-a.x,y-a.y}; } vec operator /(const long double &a) const{ return {x/a,y/a}; } long double len() const{ return sqrt(x*x+y*y); } long double dot(const vec &a) const{ return x*a.x+y*a.y; } long double crs(const vec &a) const{ return x*a.y-y*a.x; } vec proj(const vec &a) const{ return (a/a.len())*(*this).dot(a)/a.len(); } }; struct P { int x,y,z; bool operator <(const P &a) const{ return y>a.y; } }; long long x,y,z,mod=1000000007; vector<int> v1; int i,n,m,k,a,d,b,c,dx[10]={1,0,-1,0},dy[10]={0,1,0,-1}; int e; int o[221]; int l[221]; int par[1]; int j[1]; //stack<int> s; set<int> s; queue<int> q,q1; P u[211111]; char r[1]; //string r,r1; //2147483647 //'1'==49; //'A'==65; //'a'==97; //unordered_ map<int,int> p; //v.resize(unique(v.begin(),v.end())-v.begin()); //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); //rng(); std::vector<int> PickUnique(int a) { //UniqueCount(0, N-1); //UniqueCount(1, N-2); //int a=(int)v.size(); for(int t=0;t<a;t++) o[t]=UniqueCount(0,t); for(int t=a-1;t>=0;t--) l[t]=UniqueCount(t,a-1); for(int t=0;t<a;t++) { if(t>0) { if(o[t-1]+1!=o[t]) { v1.push_back(0); goto qwe; } } if(t<a-1) { if(l[t+1]+1!=l[t]) { v1.push_back(0); goto qwe; } } v1.push_back(1); qwe:; } return v1; }

컴파일 시 표준 에러 (stderr) 메시지

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:86:14: error: 'UniqueCount' was not declared in this scope
         o[t]=UniqueCount(0,t);
              ^~~~~~~~~~~
unique.cpp:88:14: error: 'UniqueCount' was not declared in this scope
         l[t]=UniqueCount(t,a-1);
              ^~~~~~~~~~~
unique.cpp:87:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for(int t=a-1;t>=0;t--)
     ^~~
unique.cpp:89:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  for(int t=0;t<a;t++)
  ^~~