#include #include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);++i) int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin>>N; stack st; st.push(2e9); int wb=0; rep(i,N){ int H; cin>>H; int mae=0; while(st.top()