Skip to content

Commit f319dd4

Browse files
gcd
1 parent fa9c358 commit f319dd4

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

头文件及测试/Template-Abridged.cpp

Lines changed: 0 additions & 16 deletions
This file was deleted.

头文件及测试/Template.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ template<typename T>
111111
T sqr(T x) { return x * x; }
112112

113113
ll gcd(ll a, ll b) {
114+
a = abs(a),b = abs(b);
114115
while(b != 0) {
115116
a %= b;
116117
swap(a, b);
117118
}
118-
return abs(a);
119+
return a;
119120
}
120121

121122
ll fast(ll a, ll b, ll mod) {

0 commit comments

Comments
 (0)