Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf62ab87

Browse files
authored
Update count-number-of-trapezoids-ii.cpp
1 parentf6a6df1 commitf62ab87

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎C++/count-number-of-trapezoids-ii.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ class Solution {
3131
constauto& g =gcd(dx, dy);
3232
int a = dx / g, b = dy / g;
3333
if (a <0 || (a ==0 && b <0)) {
34-
a = -a;
35-
b = -b;
34+
a = -a, b = -b;
3635
}
3736
constint c = b * x1 - a * y1;
3837
result += lookup_slope[tuple(a, b)]++ - lookup_line[tuple(a, b, c)]++;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp