8000 add range sum to BIT · atcoder/live_library@875d2be · GitHub
[go: up one dir, main page]

Skip to content

Commit 875d2be

Browse files
author
atcoder-live
committed
add range sum to BIT
1 parent 5744cc2 commit 875d2be

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bit.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ struct BIT {
1717
}
1818
return x;
1919
}
20+
T sum(int l, int r) {
21+
return sum(r-1) - sum(l-1);
22+
}
2023
};

0 commit comments

Comments
 (0)
0