#include <iostream> using namespace std; int main() { int n, q, l, r, tmp; cin >> n >> q; auto* a = (long int*)malloc(sizeof(long int)*(n+1));//数组a存储前n个元素之和 a[0] = 0; for(int i = 1; i <= n; i++){ cin >> tmp; a[i] = a[i-1]+tmp; ...