ContinueLib

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

View the Project on GitHub Continue765/ContinueLib

:heavy_check_mark: test/library_checker/z_algorithm.test.cpp

Depends on

Code

#define PROBLEM "https://judge.yosupo.jp/problem/zalgorithm"
#include <common.hpp>
#include "string/z_algo.hpp"

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    auto z = Z(s);
    for (int i = 0; i < (int)s.size(); ++i) cout << z[i] << (i + 1 == (int)s.size() ? '\n' : ' ');
}
Back to top page