Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/acm-clan/algorithm-stone
/ Query
Method
Query
templates/binary-index-tree.cpp:16–23 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
14
}
15
16
int Query(int x)
17
{
18
int ans = 0;
19
for (int i = x; i > 0; i -= Lowbit(i)) {
20
ans += tree[i];
21
}
22
return ans;
23
}
24
25
void Add(int x, int u)
26
{
Callers
2
test_perf
Function · 0.80
test
Function · 0.80
Calls
no outgoing calls
Tested by
1
test_perf
Function · 0.64