@@ -13,25 +13,25 @@ int main() {
1313 sa_query sf_a (s, 256 );
1414 {
1515 auto [sa_le, sa_ri, s_l, s_r] =
16- sf_a.find_str_fast (string (" " ));
16+ sf_a.find_str_fast (string (" " ));
1717 assert (sa_le == 0 && sa_ri == sz (s));
1818 pair<int , int > short_res = sf_a.find_str (string (" " ));
1919 assert (sa_le == short_res.first &&
20- sa_ri == short_res.second );
20+ sa_ri == short_res.second );
2121 assert (s_r - s_l == 0 );
2222 }
2323 auto [sa_le, sa_ri, s_l, s_r] = sf_a.find_str_fast (t);
2424 pair<int , int > short_res = sf_a.find_str (t);
2525 assert (
26- sa_le == short_res.first && sa_ri == short_res.second );
26+ sa_le == short_res.first && sa_ri == short_res.second );
2727 int str_len = s_r - s_l;
2828 assert (s.substr (s_l, str_len) == t.substr (0 , str_len));
2929 assert (str_len <= sz (t));
3030 assert (str_len == sz (t) || s_r == sz (s) ||
31- t[str_len] != s[s_r]);
31+ t[str_len] != s[s_r]);
3232 assert ((sa_le < sa_ri) == (str_len == sz (t)));
3333 vector<int > matches (begin (sf_a.sa ) + sa_le,
34- begin (sf_a.sa ) + sa_ri);
34+ begin (sf_a.sa ) + sa_ri);
3535 sort (begin (matches), end (matches));
3636 {
3737 // test find_substrs_concated
@@ -41,34 +41,34 @@ int main() {
4141 vector<vector<pii>> tests;
4242 if (sz (t) >= 2 )
4343 tests.push_back ({{t_start, t_start + 1 },
44- {t_start + 1 , t_start + 1 },
45- {t_start + 1 , t_start + sz (t)}});
44+ {t_start + 1 , t_start + 1 },
45+ {t_start + 1 , t_start + sz (t)}});
4646 for (int num_tests = 10 ; num_tests--;) {
47- vector<int > splits = {0 , size (t )};
47+ vector<int > splits = {0 , int ( sz (t) )};
4848 for (int num_splits = rnd (0 , 4 ); num_splits--;)
4949 splits.push_back (rnd<int >(0 , sz (t) - 1 ));
5050 sort (begin (splits), end (splits));
5151 vector<pair<int , int >> subs;
5252 for (int i = 1 ; i < sz (splits); i++)
5353 subs.emplace_back (splits[i - 1 ] + t_start,
54- splits[i] + t_start);
54+ splits[i] + t_start);
5555 tests.push_back (subs);
5656 }
5757 for (const vector<pii>& subs : tests) {
5858 auto [sa_le2, sa_ri2, s_le2, s_ri2] =
59- lq_both.find_substrs_concated (subs);
59+ lq_both.find_substrs_concated (subs);
6060 pair<int , int > short_res2 =
61- lq_both.find_substr (t_start, sz (both));
61+ lq_both.find_substr (t_start, sz (both));
6262 assert (sa_le2 == short_res2.first &&
63- sa_ri2 == short_res2.second );
63+ sa_ri2 == short_res2.second );
6464 assert (both.substr (s_le2, s_ri2 - s_le2) == t);
6565 assert (sa_ri2 - sa_le2 == 1 + sa_ri - sa_le);
6666 vector<int > matches_other (begin (lq_both.sa ) + sa_le2,
67- begin (lq_both.sa ) + sa_ri2);
67+ begin (lq_both.sa ) + sa_ri2);
6868 matches_other.erase (
69- remove_if (begin (matches_other), end (matches_other),
70- [&](int val) { return val >= sz (s) + 1 ; }),
71- end (matches_other));
69+ remove_if (begin (matches_other), end (matches_other),
70+ [&](int val) { return val >= sz (s) + 1 ; }),
71+ end (matches_other));
7272 sort (begin (matches_other), end (matches_other));
7373 assert (matches == matches_other);
7474 }
0 commit comments