1 条题解

  • 1
    @ 2021-11-14 18:38:10

    大水题,暴力加即可。

    #include <bits/stdc++.h>
    using namespace std;
    
    inline int read() {
    	int x = 0, f = 0; char c = 0;
    	while (!isdigit(c)) f |= c == '-', c = getchar();
    	while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
    	return f ? -x : x;
    }
    
    #define N 110
    
    int n, a, b, res = 0, d[N];
    
    int main() {
        n = read();
        for (int i = 1; i < n; i ++) {
            d[i] = read();
        }
        a = read(), b = read();
        for (int i = a; i < b; i ++) {
            res += d[i];
        }
        printf("%d\n", res);
        return 0;
    }
    

    我就是来水一篇题解的

    • 1

    信息

    ID
    6926
    时间
    2000ms
    内存
    256MiB
    难度
    3
    标签
    递交数
    3
    已通过
    2
    上传者