# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
284353 | Alexa2001 | Employment (JOI16_employment) | C++17 | 217 ms | 12148 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;
const int Nmax = 4e5 + 5;
int n, q, m;
int tip[Nmax/2], val[Nmax/2], p[Nmax/2], a[Nmax/2];
vector<int> all;
class AIB
{
int ub(int x) { return (x&(-x)); }
int a[Nmax];
public:
void upd(int x, int y, int add)
{
for(; y; y-=ub(y)) a[y] += add;
for(--x; x; x-=ub(x)) a[x] -= add;
}
int query(int x)
{
int ans = 0;
for(; x<=m; x+=ub(x)) ans += a[x];
return ans;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |