MCPcopy Create free account
hub / github.com/Jonathan-Uy/CSES-Solutions / update

Function update

Dynamic Programming/Increasing Subsequence II.cpp:12–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10struct Operation { int x, idx; } ops[maxN];
11
12void update(int idx, ll val){
13 for(int i = idx; i < maxN; i += -i&i)
14 ds[i] = (ds[i] + val) % MOD;
15}
16
17ll query(int idx){
18 ll sum = 0;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected