#include<bits/stdc++.h>
using namespace std;
int main(){
int n,j;
cin>>n>>j;
int A[n];
for(int k=0;k<n;k++){
cin>>A[k];
}
int q;
cin>>q;
int a;
int l,r,m;
for(int k=0;k<q;k++){
cin>>a;
if(a==1){
cin>>a;
}
else{
cin>>l>>r>>m;
l--;
r--;
int index=1;
int sum=0;
for(int k=l;k<((l+r+1)/2);k++){
sum+=A[k]*index;
cout<<A[k]<<" "<<index<<endl;
index++;
}
index--;
if((r-l)%2==0){
index--;
}
for(int k=((l+r+1)/2);k<=r;k++){
sum+=A[k]*index;
cout<<A[k]<<" "<<index<<endl;
index--;
}
cout<<sum<<endl;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
10 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2058 ms |
19796 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2078 ms |
20776 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |