Skip to content

Commit 9db7b03

Browse files
committed
fix checkpoint
1 parent 60888f0 commit 9db7b03

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cp-algo/number_theory/factorize.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace cp_algo::math {
1515
base x, y;
1616
base g = 1;
1717
while(g == 1) {
18-
for(int i = 0; i < 64; i++) {
18+
for(int i = 1; i <= 64; i++) {
1919
x = f(x);
2020
y = f(f(y));
2121
if(x == y) [[unlikely]] {

cp-algo/util/checkpoint.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
#include <chrono>
55
#include <string>
66
namespace cp_algo {
7-
void checkpoint(std::string const& msg = "") {
7+
void checkpoint([[maybe_unused]] std::string const& msg = "") {
8+
#ifdef CP_ALGO_CHECKPOINT
89
static double last = 0;
910
double now = (double)clock() / CLOCKS_PER_SEC;
1011
double delta = now - last;
1112
last = now;
1213
if(msg.size()) {
13-
#ifdef CP_ALGO_CHECKPOINT
1414
std::cerr << msg << ": " << delta * 1000 << " ms\n";
15-
#endif
1615
}
16+
#endif
1717
}
1818
}
1919
#endif // CP_ALGO_UTIL_CHECKPOINT_HPP

0 commit comments

Comments
 (0)