cp-library

競技プログラミング用 C++ ライブラリ

View the Project on GitHub qandori/cp-library

:heavy_check_mark: test/suffix_tree_substrings.test.cpp

test/suffix_tree_substrings.test.cpp · GitHub で見る

検証問題

依存ライブラリ

コード

#define PROBLEM "https://judge.yosupo.jp/problem/number_of_substrings"
#include "../string/suffix_tree.hpp"
#include "../components/fast_io.hpp"

int main() {
	FastInput in;
	FastOutput out;
	std::string s;
	in.read(s);
	SuffixTree tree(s);
	out.println(tree.distinct_substrings());
}
Back to top page