#include <bits/stdc++.h>
#define nikah ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
const ll maxn = 1e5+7;
using namespace std;
ll n,q,k;
ll a[maxn], pref[maxn];
int main() {
nikah
cin>>n>>k;
for (ll i=1; i<=n; i++) {
cin>>a[i];
pref[i] = a[i] + pref[i-1];
}
cin>>q;
while (q--) {
ll mode,l,r,m; cin>>mode>>l>>r>>m;
if (mode == 2) {
ll ans = 0, re = l + m - 1;
while (re <= r) {
for (ll i=l; i<=re; i++) {
ans += a[i];
}
re++;
l++;
}
cout<<ans<<endl;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2040 ms |
856 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2075 ms |
1116 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |