algorithm

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub satashun/algorithm

:warning: cpp_src/string/Trie_old.cpp

Code

struct Trie {
	int value;
	Trie *next[0x100];
	Trie() { fill(next, next+0x100, nullptr); }
};

Trie *find(const string &t, Trie *r) {
	for (int i = 0; i < t.size(); ++i) {
		char c = t[i];
		if (!r->next[c]) r->next[c] = new Trie;
		r = r->next[c];
	}
	return r;
}
#line 1 "cpp_src/string/Trie_old.cpp"
struct Trie {
	int value;
	Trie *next[0x100];
	Trie() { fill(next, next+0x100, nullptr); }
};

Trie *find(const string &t, Trie *r) {
	for (int i = 0; i < t.size(); ++i) {
		char c = t[i];
		if (!r->next[c]) r->next[c] = new Trie;
		r = r->next[c];
	}
	return r;
}
Back to top page