MCPcopy Create free account
hub / github.com/cp-algorithms/cp-algorithms / naive

Function naive

test/test_discrete_log.cpp:60–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58};
59
60int naive(int a, int b, int m) {
61 a %= m, b %= m;
62 int cur = 1 % m;
63 for (int x = 0; x < m; x++) {
64 if (cur == b) {
65 return x;
66 }
67 cur = cur * 1ll * a % m;
68 }
69 return -1;
70}
71
72vector<TestData> generate_small_cases(bool coprime_only) {
73 vector<TestData> test_data;

Callers 1

generate_small_casesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected