Content-Length: 270965 | pFad | http://github.com/cp-algorithms/cp-algorithms/commit/da025de7bda78c323c317cc9e74b71334b21233b

D6 Updated c++ code to work on current style of suffix automaton · cp-algorithms/cp-algorithms@da025de · GitHub
Skip to content

Commit da025de

Browse files
authored
Updated c++ code to work on current style of suffix automaton
This is tested on current suffix automaton. Also, made more modular
1 parent 9075aed commit da025de

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/string/suffix-automaton.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,12 @@ Therefore, given $minlen(v) = 1 + len(link(v))$, we have total distinct substrin
501501
This is demonstrated succinctly below:
502502
503503
```cpp
504-
long long tot{};
505-
for(int i=1;i<sz;i++) {
506-
tot+=len[i] - len[link[i]];
504+
long long get_diff_strings(){
505+
ll tot{};
506+
for(int i=1;i<sz;i++) {
507+
tot+=st[i].len-st[st[i].link].len;
508+
}
509+
return tot;
507510
}
508511
```
509512

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/cp-algorithms/cp-algorithms/commit/da025de7bda78c323c317cc9e74b71334b21233b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy