prog.cpp:1:5: error: ‘Solution’ has not been declared
int Solution::lis(const vector<int> &A) {
^~~~~~~~
prog.cpp:1:25: error: ‘vector’ does not name a type
int Solution::lis(const vector<int> &A) {
^~~~~~
prog.cpp:1:31: error: expected ‘,’ or ‘...’ before ‘<’ token
int Solution::lis(const vector<int> &A) {
^
prog.cpp: In function ‘int lis(int)’:
prog.cpp:2:5: error: ‘set’ was not declared in this scope
set<int> s;
^~~
prog.cpp:2:9: error: expected primary-expression before ‘int’
set<int> s;
^~~
prog.cpp:3:9: error: expected primary-expression before ‘int’
set<int> :: iterator itr;
^~~
prog.cpp:4:5: error: ‘unordered_map’ was not declared in this scope
unordered_map<int,int> m;
^~~~~~~~~~~~~
prog.cpp:4:19: error: expected primary-expression before ‘int’
unordered_map<int,int> m;
^~~
prog.cpp:5:5: error: ‘vector’ was not declared in this scope
vector<int> lis(A.size()), temp(A.size()+1,INT_MAX);
^~~~~~
prog.cpp:5:12: error: expected primary-expression before ‘int’
vector<int> lis(A.size()), temp(A.size()+1,INT_MAX);
^~~
prog.cpp:7:9: error: ‘A’ was not declared in this scope
if(!A.size()) return 0;
^
prog.cpp:8:5: error: ‘s’ was not declared in this scope
s.insert(-A[0]);
^
prog.cpp:8:15: error: ‘A’ was not declared in this scope
s.insert(-A[0]);
^
prog.cpp:9:5: error: ‘m’ was not declared in this scope
m[A[0]] = 0;
^
prog.cpp:10:10: warning: pointer to a function used in arithmetic [-Wpointer-arith]
lis[0] = 1;
^
prog.cpp:10:14: error: assignment of function ‘int lis(int)’
lis[0] = 1;
^
prog.cpp:10:14: error: cannot convert ‘int’ to ‘int(int)’ in assignment
prog.cpp:11:5: error: ‘temp’ was not declared in this scope
temp[1] = A[0];
^~~~
prog.cpp:13:9: error: ‘itr’ was not declared in this scope
itr = upper_bound(s.begin(), s.end(), -A[i]);
^~~
prog.cpp:13:52: error: ‘upper_bound’ was not declared in this scope
itr = upper_bound(s.begin(), s.end(), -A[i]);
^
prog.cpp:15:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
lis[i] = 1;
^
prog.cpp:15:22: error: assignment of read-only location ‘*(lis + ((sizetype)i))’
lis[i] = 1;
^
prog.cpp:15:22: error: cannot convert ‘int’ to ‘int(int)’ in assignment
prog.cpp:18:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
lis[i] = lis[m[-*itr]] + 1;
^
prog.cpp:20:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
ans = max(ans, lis[i]);
^
prog.cpp:20:30: error: ‘max’ was not declared in this scope
ans = max(ans, lis[i]);
^
prog.cpp:23:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
if(A[i] < temp[lis[i]]){
^
prog.cpp:24:26: warning: pointer to a function used in arithmetic [-Wpointer-arith]
if(temp[lis[i]] != INT_MAX){
^
prog.cpp:24:32: error: ‘INT_MAX’ was not declared in this scope
if(temp[lis[i]] != INT_MAX){
^~~~~~~
prog.cpp:25:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
m.erase(temp[lis[i]]);
^
prog.cpp:26:36: warning: pointer to a function used in arithmetic [-Wpointer-arith]
s.erase(-temp[lis[i]]);
^
prog.cpp:28:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
temp[lis[i]] = A[i];
^