Submission #1128841

#TimeUsernameProblemLanguageResultExecution timeMemory
1128841Alihan_8Sterilizing Spray (JOI15_sterilizing)C++20
5 / 100
5095 ms1556 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, q, k; cin >> n >> q >> k; vector <int> c(n + 1); for ( int i = 1; i <= n; i++ ) cin >> c[i]; while ( q-- ){ int t, l, r; cin >> t >> l >> r; if ( t == 1 ){ c[l] = r; } else if ( t == 2 ){ for ( int i = l; i <= r; i++ ) c[i] /= k; } else{ int cnt = 0; for ( int i = l; i <= r; i++ ) cnt += c[i]; cout << cnt << '\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...