Submission #50836

#TimeUsernameProblemLanguageResultExecution timeMemory
50836faishol27Sterilizing Spray (JOI15_sterilizing)C++14
5 / 100
24 ms1548 KiB
//////////////////////////////////////////////// // // // Author: Muhammad Faishol Amirul Mukminin // // // //////////////////////////////////////////////// #include <bits/stdc++.h> using namespace std; typedef long long ll; int N, Q, K; ll data[3005]; int main(){ cin >> N >> Q >> K; for(int i=1;i<=N;i++) cin >> data[i]; while(Q--){ int id; ll a, b; cin >> id >> a >> b; if(id == 1){ data[a] = b; }else if(id == 2){ for(int i=a; i<=b;i++) data[i] /= K; }else{ ll ans = 0; for(int i=a;i<=b;i++) ans += data[i]; cout << ans << endl; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...