We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 423bb1d commit 3eff82fCopy full SHA for 3eff82f
src/ch01/0302.cpp
@@ -1,15 +1,10 @@
1
-#include <ctime>
+#include <ctime> // using srand()
2
const int64 MAXN = 105;
3
int64 gcd(int64 a, int64 b)
4
{
5
if (a == 0) return 1;
6
- if (a < 0) return gcd(-a, b);
7
- while (b)
8
- {
9
- int64 t = a; a = b; b = t % b;
10
- }
11
- return a;
12
-
+ if (a < 0) return __gcd(-a, b);
+ return __gcd(a, b);
13
}
14
15
int64 mul_mod(int64 a, int64 b, int64 m)
src/ch01/0401.cpp
@@ -1,8 +1,7 @@
const double eps = 1e-15;
inline bool test(double x)
- // true : l = mid
- // false: r = mid
+ // true : l = mid, false: r = mid
/**Specific Calculation**/
double Bsearch(double l, double r)
0 commit comments