MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / lexicok

Method lexicok

code/strings/suffix_automaton.cpp:47–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 i != next[cur.first].end();++i){
46 S.push(ii((*i).second, 0)); } } } }
47 string lexicok(ll k){
48 int st = 0; string res; map<char,int>::iterator i;
49 while(k){
50 for(i = next[st].begin(); i != next[st].end(); ++i){
51 if(k <= cnt[(*i).second]){ st = (*i).second;
52 res.push_back((*i).first); k--; break;
53 } else { k -= cnt[(*i).second]; } } }
54 return res; }
55 void countoccur(){
56 for(int i = 0; i < sz; ++i){ occur[i] = 1 - isclone[i]; }
57 vii states(sz);

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected