Complete rework of the queueing system. Adding some more helper functions in maths.c. FInally, adding valgrind (a debugger) in the nix flaes file.
Stergios Upload Compile Checker / Explore-Gitea-Actions (push) Successful in 16s

This commit is contained in:
metallaxis committed 2026-07-05 02:15:26 +03:00
1 parent 953ada5b26
commit 030b73597f
9 files changed
+79 -62

No files matched your search

-18
View File
@@ -126,24 +126,6 @@ static bool bfs(int128_t* sum, int128_t a0, int128_t b0, int128_t c0, int print_
}
bool solve(int128_t* sum, int128_t a0, int128_t b0, int128_t c0, int print_mode) {
/* Try greedy first */
int32_t g = -1;//greedy(a0, b0, c0);
if (g >= 0) {
*sum += g;
if (print_mode == 1) {
printf("\nSolution found!\n");
printf("Initial: (");
print_int128(a0); printf(", ");
print_int128(b0); printf(", ");
print_int128(c0); printf(")\n");
printf("Moves (%i): [greedy]\n", g);
} else if (print_mode == 2) {
print_int128(c0);
printf(" the required amount of moves is: %i\n", g);
}
return true;
}
/* Fallback to BFS */
return bfs(sum, a0, b0, c0, print_mode);
}