Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Seng

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

Language: cpp

Time: 0.112 second

Submitted On: 2026-01-03 11:14:39

#include <bits/stdc++.h>
using namespace std;
int arr[1000001];

int main(){

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

    cin >> x >> y;
    int ans = 0;

    for(int i = x; i <= y; i++){
        ans += arr[i];
    }

    cout << ans;

    return 0;
}