prog.cpp:6:30: error: ‘vector’ has not been declared
int largestRectangleArea(vector<int>& heights) {
^~~~~~
prog.cpp:6:36: error: expected ‘,’ or ‘...’ before ‘<’ token
int largestRectangleArea(vector<int>& heights) {
^
prog.cpp:10:13: error: ‘vector’ has not been declared
int daq(vector<int>& heights, int left, int right) {
^~~~~~
prog.cpp:10:19: error: expected ‘,’ or ‘...’ before ‘<’ token
int daq(vector<int>& heights, int left, int right) {
^
prog.cpp: In member function ‘int Solution::largestRectangleArea(int)’:
prog.cpp:7:20: error: ‘heights’ was not declared in this scope
return daq(heights, 0, heights.size() - 1);
^~~~~~~
prog.cpp: In member function ‘int Solution::daq(int)’:
prog.cpp:12:20: error: ‘heights’ was not declared in this scope
return heights[left];
^~~~~~~
prog.cpp:18:25: error: invalid operands of types ‘std::ios_base&(std::ios_base&)’ and ‘std::ios_base&(std::ios_base&)’ to binary ‘operator+’
int mid = (left + right) / 2;
~~~~~^~~~~~~
prog.cpp:20:34: error: ‘INT_MAX’ was not declared in this scope
int mx = -1, minHeight = INT_MAX;
^~~~~~~
prog.cpp:22:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
while (left <= tempLeft && tempRight <= right) {
^~~~~~~~
prog.cpp:22:49: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
while (left <= tempLeft && tempRight <= right) {
^~~~~
prog.cpp:23:40: error: ‘heights’ was not declared in this scope
minHeight = min(minHeight, heights[tempLeft]);
^~~~~~~
prog.cpp:26:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if (left < tempLeft && tempRight < right) {
^~~~~~~~
prog.cpp:26:48: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if (left < tempLeft && tempRight < right) {
^~~~~
prog.cpp:32:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
} else if (left == tempLeft) {
^~~~~~~~
prog.cpp:40:28: error: ‘heights’ was not declared in this scope
res = max(res, daq(heights, left, mid));
^~~~~~~