forked from simongog/sdsl-lite
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpl-18.cpp
More file actions
Latest commit
19 lines (17 loc) · 590 Bytes
/
Copy pathexpl-18.cpp
File metadata and controls
19 lines (17 loc) · 590 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<sdsl/suffix_arrays.hpp>
#include<iostream>
#include<algorithm>
usingnamespacestd;
usingnamespacesdsl;
intmain()
{
csa_wt<wt_huff<rrr_vector<63>>,4,8> csa; // 接尾辞配列
construct(csa, "expl-18.cpp", 1);
cout << "count(\"配列\") : " << count(csa, "配列") << endl;
auto occs = locate(csa, "\n");
sort(occs.begin(), occs.end());
auto max_line_length = occs[0];
for (size_t i=1; i < occs.size(); ++i)
max_line_length = std::max(max_line_length, occs[i]-occs[i-1]+1);
cout << "max line length : " << max_line_length << endl;
}