# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
475440 |
2021-09-22T12:35:34 Z |
dzdzx |
Addk (eJOI21_addk) |
C++17 |
|
997 ms |
2264 KB |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,w;
cin>>n>>w;
int x[n];
for (int i=0;i<n;i++){
cin>>x[i];
}
int q;
cin>>q;
for (int i=0;i<q;i++){
char t;
cin>>t;
if (t=='2'){
int a,b,c;
cin>>a>>b>>c;a--;b--;
int sum=0;int k=1;
for (int j=a;j<a+c-1;j++){
sum+=k*x[j];
k++;
}
k=c;
for (int j=a+c-1;j<b-c+2;j++){
sum+=k*x[j];
}
k--;
for (int j=b-c+2;j<=b;j++){
sum+=k*x[j];
k--;
}
cout<<sum<<endl;
}else{
for (int j=0;j<w;j++){
int z;
cin>>z;
}
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
301 ms |
752 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
997 ms |
2264 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |