#include<iostream>
using namespace std;
typedef long long int lld;
int main(){
int n,q,k;
cin>>n>>q>>k;
lld arr[n];
for(int i=0;i<n;i++)cin>>arr[i];
while(q--){
int x,y,z;
cin>>x>>y>>z;
if(x==1){y--;
arr[y]=z;
}
if(x==2){y--;z--;
for(int i=y;i<=z;i++)arr[i]/=k;
}
if(x==3){y--;z--;
lld sum=0;
for(int i=y;i<=z;i++)sum+=arr[i];
cout<<sum<<endl;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
376 KB |
Output is correct |
2 |
Correct |
5 ms |
448 KB |
Output is correct |
3 |
Correct |
4 ms |
704 KB |
Output is correct |
4 |
Correct |
11 ms |
704 KB |
Output is correct |
5 |
Correct |
18 ms |
704 KB |
Output is correct |
6 |
Correct |
18 ms |
900 KB |
Output is correct |
7 |
Correct |
18 ms |
900 KB |
Output is correct |
8 |
Correct |
17 ms |
964 KB |
Output is correct |
9 |
Correct |
19 ms |
1160 KB |
Output is correct |
10 |
Correct |
18 ms |
1264 KB |
Output is correct |
11 |
Correct |
18 ms |
1264 KB |
Output is correct |
12 |
Correct |
18 ms |
1284 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
5077 ms |
3376 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
352 ms |
3376 KB |
Output is correct |
2 |
Correct |
771 ms |
3376 KB |
Output is correct |
3 |
Correct |
1198 ms |
3484 KB |
Output is correct |
4 |
Correct |
2678 ms |
4696 KB |
Output is correct |
5 |
Execution timed out |
5023 ms |
6032 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4025 ms |
7304 KB |
Output is correct |
2 |
Correct |
4590 ms |
7468 KB |
Output is correct |
3 |
Correct |
2437 ms |
7468 KB |
Output is correct |
4 |
Correct |
3448 ms |
7468 KB |
Output is correct |
5 |
Execution timed out |
5022 ms |
7788 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |