From b222671acd6d440a5c5f9abdd6f457189a8a7632 Mon Sep 17 00:00:00 2001 From: Eat-Swap Date: Sun, 5 Jun 2022 02:13:49 +0800 Subject: [PATCH] fix: wrong implementation --- cpp/more/0304.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/more/0304.cpp b/cpp/more/0304.cpp index 5d20885..7d4026b 100644 --- a/cpp/more/0304.cpp +++ b/cpp/more/0304.cpp @@ -30,8 +30,8 @@ public: } int sumRegion(int x0, int y0, int x1, int y1) { - x1--; - y1--; + x1++; + y1++; return prefixSum[x1 * n + y1] - prefixSum[x0 * n + y1] - prefixSum[x1 * n + y0] + prefixSum[x0 * n + y0]; } };