Problem minstack
User Niraideepa715
Submission Time 2024-12-11 15:11:40
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp:5:20: error: ‘MAX’ was not declared in this scope
5 | vector <int> mn = [MAX];
| ^~~
minstack.cpp: In lambda function:
minstack.cpp:5:24: error: expected ‘{’ before ‘;’ token
5 | vector <int> mn = [MAX];
| ^
minstack.cpp: At global scope:
minstack.cpp:5:24: error: conversion from ‘<lambda()>’ to non-scalar type ‘std::vector<int>’ requested
minstack.cpp: In function ‘void push(int)’:
minstack.cpp:8:16: error: expected ‘;’ before ‘mn’
8 | v.push_back(x)
| ^
| ;
9 | mn.push_back(min(mn.back(),x));
| ~~
minstack.cpp: In function ‘void pop()’:
minstack.cpp:14:13: error: ‘x’ was not declared in this scope
14 | v.pop_back(x);
| ^
minstack.cpp: In function ‘int top()’:
minstack.cpp:19:17: error: expected ‘;’ before ‘}’ token
19 | retu