#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
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];
cout<<x[j]<<" "<<k<<endl;
k++;
}
k=c;
for (int j=a+c-1;j<b-c+2;j++){
sum+=k*x[j];
cout<<x[j]<<" "<<k<<endl;
}
k--;
for (int j=b-c+2;j<=b;j++){
sum+=k*x[j];
cout<<x[j]<<" "<<k<<endl;
k--;
}
cout<<sum<<endl;
}else{
for (int j=0;j<k;j++){
int z;
cin>>z;
}
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
16 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2084 ms |
15124 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2095 ms |
15780 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |