이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define int long long
int Tree[3000000];
int N=(1<<(int)(log2(1000000)));
signed main()
{
int n,k,q;
cin>>n>>q>>k;
int arr[n+1];
for(int i=0;i<n;i++){
cin>>arr[i];
Tree[i+N]=arr[i];
}
if(n<=3000&&q<=3000){
while(q--){
int type;
cin>>type;
if(type==1){
int indx,b;
cin>>indx>>b;
arr[indx-1]=b;
}
if(type==2){
int l,r;
cin>>l>>r;
for(int i=l-1;i<r;i++){
arr[i]=arr[i]/k;
}
}
if(type==3){
int l,r,sum=0;
cin>>l>>r;
for(int i=l-1;i<r;i++){
sum+=arr[i];
}
cout<<sum<<endl;
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |