cp-library

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

View the Project on GitHub qandori/cp-library

:heavy_check_mark: test/longest_common_substring.test.cpp

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

検証問題

依存ライブラリ

コード

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

int main() {
	FastInput input;
	FastOutput output;
	std::string s, t;
	input.read(s);
	input.read(t);
	auto [a, b, length] = longest_common_substring(s, t);
	output.write(a);
	output.write(' ');
	output.write(a + length);
	output.write(' ');
	output.write(b);
	output.write(' ');
	output.println(b + length);
}
Back to top page