Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Score: 100
User: Asphyrv
Problemset: ผลบวก (ง่าย)
Language: cpp
Time: 0.046 second
Submitted On: 2024-11-11 23:11:40
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll p[1000006];
int main(){
cin.tie(NULL)->ios_base::sync_with_stdio(false);
int n, a, x, y;
cin >> n;
for(int i=1; i<=n; i++){
cin >> a;
p[i] = p[i-1] + a;
//cout << p[i] << ' ';
}
cin >> x >> y;
cout << p[y+1] - p[x];
return 0;
}