4题 同样的思路, 不知道为什么只过了20% for(int k = 0; k < N; ++ k) { for (int e = k; e < N; ++ e) { if (区间和(e,k) == M) { ++ res; k = e - 1; } } }