题解移步 orzA #include <bits/stdc++.h> using namespace std; void solve() { int n; std::cin >> n; std::vector<pair<int, int>> p(n + 1); for (int i = 1; i <= n; i++) { auto &[x, y] = p[i]; std::cin >> x; y = i; } std::sort(p.begin() + 1, p.end()); for (int i = 1; i <...