cp-library

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

View the Project on GitHub qandori/cp-library

:heavy_check_mark: test/z_algorithm.test.cpp

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

検証問題

依存ライブラリ

コード

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

int main() {
	FastInput input;
	FastOutput output;
	std::string s;
	input.read(s);
	auto z = z_algorithm(s);
	for (int i = 0; i < int(z.size()); ++i) {
		if (i) output.write(' ');
		output.write(z[i]);
	}
	output.write('\n');
}
Back to top page