summaryrefslogtreecommitdiff
path: root/acwing/1247.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-03-24 16:32:51 +0800
committercrupest <crupest@outlook.com>2021-03-24 16:32:51 +0800
commitf6ac881125639d68036d3e158609f56a504dede6 (patch)
treefd47083a964a2ea3f7bbcac7b9a5e6f2fd47d1b3 /acwing/1247.cpp
parent3b9141e83623b0b7b18ae1c38f53d51d189decba (diff)
downloadsolutions-f6ac881125639d68036d3e158609f56a504dede6.tar.gz
solutions-f6ac881125639d68036d3e158609f56a504dede6.tar.bz2
solutions-f6ac881125639d68036d3e158609f56a504dede6.zip
Fix acwing 1247.
Diffstat (limited to 'acwing/1247.cpp')
-rw-r--r--acwing/1247.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/acwing/1247.cpp b/acwing/1247.cpp
index 132c63c..1fd4412 100644
--- a/acwing/1247.cpp
+++ b/acwing/1247.cpp
@@ -29,7 +29,7 @@ int main() {
result += 2 * max;
}
- if (M == 1 && min > 0) {
+ if (M != 0 && min > 0) {
result -= 2 * min;
}