Submission #1100610

#TimeUsernameProblemLanguageResultExecution timeMemory
1100610tsengangSterilizing Spray (JOI15_sterilizing)C++17
5 / 100
5074 ms1608 KiB
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() using namespace std; int main() { ll n,q,k; cin >> n >> q >> k; ll a[n+2]; for(ll i = 1; i <= n; i++){ cin >> a[i]; } while(q--){ ll s,x,y; cin >> s >> x >> y; if(s == 1){ a[x] = y; } if(s == 2){ for(ll i = x; i <= y; i++)a[i] /= k; } if(s == 3){ ll sum = 0; for(ll i = x; i <= y; i++){ sum+=a[i]; } cout << sum << '\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...