Submission #1130585

#TimeUsernameProblemLanguageResultExecution timeMemory
1130585lopkusSterilizing Spray (JOI15_sterilizing)C++20
5 / 100
5093 ms1548 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, q, k; cin >> n >> q >> k; vector<int> a(n + 1); for(int i = 1; i <= n; i++) { cin >> a[i]; } while(q--) { int o; cin >> o; if(o == 1) { int index, value; cin >> index >> value; a[index] = value; } else if(o == 2) { int l, r; cin >> l >> r; for(int i = l; i <= r; i++) { a[i] /= k; } } else { int l, r; cin >> l >> r; int ans = 0; for(int i = l; i <= r; i++) { ans += a[i]; } cout << ans << "\n"; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...