# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1036071 |
2024-07-27T03:19:55 Z |
kebine |
Addk (eJOI21_addk) |
C++17 |
|
89 ms |
3924 KB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int n,k;
cin>>n>>k;
ll a[n+1],p1[n+1],p2[n+1];
a[0]=p1[0]=p2[0]=0;
for(int i=1;i<=n;i++){
cin>>a[i];
p1[i]=p1[i-1]+a[i];
p2[i]=p2[i-1]+p1[i];
}
int q;
cin>>q;
while(q--){
int t;
cin>>t;
if(t==2){
int l,r,m;
cin>>l>>r>>m;
ll ans=p2[r]-p2[l+m-2]-p2[r-m];
if(l>1)ans-=p2[l-2];
cout<<ans<<'\n';
}else{
int x[k];
for(int i=0;i<k;i++)cin>>x[i];
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
35 ms |
1620 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
89 ms |
3924 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |