Runtime error no test case passed

#include<bits/stdc++.h>
using namespace std;

int answer(vector&arr){
int n = arr.size();
if(n==0){
return 0;
}

int area;
int maximum = 0;
int i=0;
stacks;
while(i<n){
if(s.empty()==true || arr[s.top()]<=arr[i]){
s.push(i++);
}else{
int x = s.top();
s.pop();

if(s.empty()==false){
	area = arr[x]*(i);
}else{
	area = arr[x]*(i-s.top()-1);
}

maximum = max(maximum,area);

}

}

while(s.empty()==false){
int x = s.top();
s.pop();
if(s.empty()==false){
area = arr[x](i);
}else{
area = arr[x]
(i-s.top()-1);
}

maximum = max(maximum,area);

}

return maximum;

}

int main() {
int n;
cin>>n;
vectorarr;
for(int i=0;i<n;i++){
int y;
cin>>y;
arr.push_back(y);
}

return answer(arr);

}

what is the problem with this code

@Mohitpandey29
It seems like your code is fine. You need to use long long instead of int.
And next time please send your code on CB IDE.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.