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

Function main

test/test_main_lorentz.cpp:10–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "main_lorentz.h"
9
10int main() {
11 find_repetitions("acababaee");
12 sort(repetitions.begin(), repetitions.end());
13 vector<pair<int, int>> expected = {
14 {2, 5},
15 {3, 6},
16 {7, 8}
17 };
18 assert(expected == repetitions);
19
20 repetitions.clear();
21 find_repetitions("abaaba");
22 sort(repetitions.begin(), repetitions.end());
23 expected = {
24 {0, 5},
25 {2, 3}
26 };
27 assert(expected == repetitions);
28
29 repetitions.clear();
30 find_repetitions("aaaaaa");
31 sort(repetitions.begin(), repetitions.end());
32 expected = {
33 {0, 1},
34 {0, 3},
35 {0, 5},
36 {1, 2},
37 {1, 4},
38 {2, 3},
39 {2, 5},
40 {3, 4},
41 {4, 5},
42 };
43 assert(expected == repetitions);
44}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected