prog.cpp:3:26: error: ‘vector’ has not been declared
int maximalRectangle(vector<vector<char>>& f) {
^~~~~~
prog.cpp:3:32: error: expected ‘,’ or ‘...’ before ‘<’ token
int maximalRectangle(vector<vector<char>>& f) {
^
prog.cpp: In member function ‘int Solution::maximalRectangle(int)’:
prog.cpp:4:20: error: ‘f’ was not declared in this scope
int rows = f.size(), cols = f[0].size();
^
prog.cpp:5:9: error: ‘vector’ was not declared in this scope
vector<int> a(cols,0);
^~~~~~
prog.cpp:5:16: error: expected primary-expression before ‘int’
vector<int> a(cols,0);
^~~
prog.cpp:8:31: error: ‘cols’ was not declared in this scope
for (int j = 0; j < cols; j++) {
^~~~
prog.cpp:8:31: note: suggested alternative: ‘rows’
for (int j = 0; j < cols; j++) {
^~~~
rows
prog.cpp:9:33: error: ‘a’ was not declared in this scope
if (f[i][j] == '1') a[j]++;
^
prog.cpp:10:18: error: ‘a’ was not declared in this scope
else a[j] = 0;
^
prog.cpp:12:23: error: ‘a’ was not declared in this scope
for (auto j:a) cout << j << " ";
^
prog.cpp:12:26: error: ‘cout’ was not declared in this scope
for (auto j:a) cout << j << " ";
^~~~
prog.cpp:13:11: error: ‘cout’ was not declared in this scope
cout << "\n";
^~~~
prog.cpp:14:19: error: ‘cols’ was not declared in this scope
int n = cols;
^~~~
prog.cpp:14:19: note: suggested alternative: ‘rows’
int n = cols;
^~~~
rows
prog.cpp:15:18: error: expected primary-expression before ‘int’
vector<int> pre(n,0);
^~~
prog.cpp:16:18: error: expected primary-expression before ‘int’
vector<int> suf(n,n - 1);
^~~
prog.cpp:17:11: error: ‘stack’ was not declared in this scope
stack<int> s;
^~~~~
prog.cpp:17:17: error: expected primary-expression before ‘int’
stack<int> s;
^~~
prog.cpp:19:17: error: ‘s’ was not declared in this scope
if (s.empty()) {
^
prog.cpp:22:36: error: ‘a’ was not declared in this scope
while (!s.empty() && a[s.top()] >= a[i]) s.pop();
^
prog.cpp:23:31: error: ‘pre’ was not declared in this scope
if (!s.empty()) pre[i] = s.top() + 1;
^~~
prog.cpp:27:19: error: ‘s’ was not declared in this scope
while (!s.empty()) s.pop();
^
prog.cpp:30:17: error: ‘s’ was not declared in this scope
if (s.empty()) {
^
prog.cpp:33:36: error: ‘a’ was not declared in this scope
while (!s.empty() && a[s.top()] >= a[i]) s.pop();
^
prog.cpp:34:31: error: ‘suf’ was not declared in this scope
if (!s.empty()) suf[i] = s.top() - 1;
^~~
prog.cpp:40:28: error: ‘suf’ was not declared in this scope
ans = max(ans,(suf[i] - pre[i] + 1) * a[i]);
^~~
prog.cpp:40:37: error: ‘pre’ was not declared in this scope
ans = max(ans,(suf[i] - pre[i] + 1) * a[i]);
^~~
prog.cpp:40:51: error: ‘a’ was not declared in this scope
ans = max(ans,(suf[i] - pre[i] + 1) * a[i]);
^
prog.cpp:40:19: error: ‘max’ was not declared in this scope
ans = max(ans,(suf[i] - pre[i] + 1) * a[i]);
^~~
prog.cpp:43:17: error: ‘max’ was not declared in this scope
fin = max(fin,ans);
^~~