#include <iostream> #include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n) { vector<int> h(n,0), L(n,0), R(n,0); int ans = n; for (int i = 0; i < n; i++) cin >> h[i]; // L[i]表示...