# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
523886 | IMystic | Sterilizing Spray (JOI15_sterilizing) | C++17 | 441 ms | 9444 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename T>
class fenwick {
public :
int n;
vector<T> fen;
explicit fenwick(vector<T> &a) : n(int(a.size())) {
fen.resize(n);
for(int i=0; i<n; i++)modify(i, a[i]);
}
T get(int p){
T v = 0;
while(p >= 0){
v += fen[p];
p = (p & ( p + 1)) - 1;
}
return v;
}
T get(int l, int r){
return (get(r) - get(l - 1));
}
void modify(int p, T v){
# | 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... |