Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Score: 100
User: Winzzwz
Problemset: ผลบวก (ง่าย)
Language: cpp
Time: 0.062 second
Submitted On: 2024-11-10 23:09:21
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int dp[1000100];
int n,x,y;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> dp[i];
if (i > 0) dp[i] += dp[i-1];
}
cin >> x >> y;
cout << dp[y]-dp[x-1];
return 0;
}