MCPcopy Create free account
hub / github.com/Jonathan-Uy/CSES-Solutions / dfs

Function dfs

String Algorithms/Repeating Substring.cpp:64–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void dfs(int u = 0){
65 vis[u] = true;
66 if(node[u].len > bestlen && node[u].cnt > 1 && u != 0){
67 bestidx = node[u].firstpos - node[u].len + 1;
68 bestlen = node[u].len;
69 }
70 for(const auto& [c, v] : node[u].nxt)
71 if(!vis[v])
72 dfs(v);
73}
74
75int main(){
76 scanf(" %s", S);

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected