# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
252706 | Vladikus004 | Go (COCI18_go) | C++14 | 1 ms | 384 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>
#define inf 2e9
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
const int M = 100 + 3, T = 2000 + 3, N = 1000 + 3;
int n, k, m, a[M], b[M], t[M], fenw[T], _b[N], _t[N];
void add(int ind, int x){
if (ind < 0) return;
for (int i = ind; i < T; i |= i + 1)
fenw[i] += x;
}
int get(int ind){
int ans = 0;
for (int i = ind; i >= 0; i = (i & (i + 1)) - 1)
ans += fenw[i];
return ans;
}
int get_sum(int l, int r){
if (!l) return get(r);
return get(r) - get(l - 1);
}
int main()
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |