cp-library

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

View the Project on GitHub qandori/cp-library

:heavy_check_mark: test/data_dependent_tree.test.cpp

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

検証問題

依存ライブラリ

コード

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

int main() {
	FastInput input;
	FastOutput output;
	std::string s;
	input.read(s);
	DataDependentTree tree;
	int root = tree.build(s);
	for (std::size_t i = 0; i < s.size(); ++i) {
		if (i) output.write(' ');
		output.write(tree.lcp(root, 0, root, i));
	}
	output.write('\n');
}
Back to top page