C题单调栈O(n) #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; vector<ll> a(n),b(n); for (ll &e : a) cin >> e; stack<int> stk; for (int i = 0;i < n; ++i) { while(!stk.empty() && a[stk.top()] < a[i]) { b[stk....