Skip to content

Commit

Permalink
include
Browse files Browse the repository at this point in the history
  • Loading branch information
maspypy committed Dec 19, 2023
1 parent 1b0df87 commit c55b4ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions datastructure/rectangle_add_point_get/sol/correct.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#include <bits/stdc++.h>
#include <cstdio>
#include <cassert>
#include <numeric>
#include <algorithm>
#include <tuple>
#include <vector>

using namespace std;

Expand Down Expand Up @@ -239,7 +244,7 @@ int main() {
for (auto &[x1, x2, y1, y2, w]: QUERY) {
if (x1 == -1) {
int x = x2, y = y1;
ll ans = bit.sum(0, x + 1, 0, y + 1);
ll ans = bit.prefix_sum(x + 1, y + 1);
printf("%lld\n", ans);
} else {
bit.add(x1, y1, +w);
Expand Down

0 comments on commit c55b4ee

Please sign in to comment.