이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main(){
int N, Q, K;
cin >> N >> Q >> K;
vector<int> C(N);
for (int i = 0; i < N; i++){
cin >> C[i];
}
for (int i = 0; i < Q; i++){
int S, T, U;
cin >> S >> T >> U;
if (S == 1){
T--;
C[T] = U;
}
if (S == 2){
T--;
for (int j = T; j < U; j++){
C[j] /= K;
}
}
if (S == 3){
T--;
long long ans = 0;
for (int j = T; j < U; j++){
ans += C[j];
}
cout << ans << endl;
}
}
}
# | 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... |