Submission

Status:
PPPPPPPPPPPPPPPPPPPP

Score: 100

User: yume_snowy

Problemset: ผลบวก (ง่าย)

Language: cpp

Time: 0.085 second

Submitted On: 2024-10-23 14:24:28

#include <iostream>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    unsigned long long a[n];

    for (int i=0; i<n; i++) {
        cin >> a[i];
    }
    
    unsigned long long sum = 0;
    
    int x,y;
    cin >> x >> y;

    for (int i=x; i<=y; i++) {
        sum+=a[i];
    }

    cout << sum;
}