思路:前缀和 ">using namespace std; typedef unsigned long long ull; const long long N = 2e6 + 100; long long n, a[N], L, R, X, q, s, t, chai[N], temp; inline void cal(long long X) { long long c = abs(chai[X]); if (chai[X] < 0) { temp = temp + t * c; } if (chai[X] > 0) { temp = temp - s * c; } } inli...