# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
768302 |
2023-06-27T21:26:16 Z |
elotelo966 |
Addk (eJOI21_addk) |
C++17 |
|
2000 ms |
1988 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define OYY 1000000005
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mid (start+end)/2
int dizi[100001];
signed main(){
fast
int n,m,deg,cev;cin>>n>>m;
for(int i=1;i<=n;i++){
cin>>dizi[i];
dizi[i]=dizi[i-1]+dizi[i];
}
int q;cin>>q;
while(q--){
int ty;cin>>ty;
if(ty==2){
int l,r,m;
cin>>l>>r>>m;
cev=0;
for(int i=l;i<=r-m+1;i++){
cev+=dizi[i+m-1]-dizi[i-1];
}
cout<<cev<<'\n';
}
else{
for(int i=0;i<m;i++)cin>>deg;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
268 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
3 ms |
340 KB |
Output is correct |
5 |
Correct |
5 ms |
340 KB |
Output is correct |
6 |
Correct |
8 ms |
340 KB |
Output is correct |
7 |
Correct |
10 ms |
468 KB |
Output is correct |
8 |
Correct |
13 ms |
468 KB |
Output is correct |
9 |
Correct |
26 ms |
460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
95 ms |
644 KB |
Output is correct |
2 |
Correct |
207 ms |
864 KB |
Output is correct |
3 |
Correct |
376 ms |
1304 KB |
Output is correct |
4 |
Correct |
1530 ms |
1988 KB |
Output is correct |
5 |
Execution timed out |
2077 ms |
1880 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
628 ms |
1108 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |