library

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub hidehic0/library

:heavy_check_mark: tests/manacher.py

Depends on

Code

# competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/enumerate_palindromes
from libs.manacher import manacher_algorithm

S = input()
T = ["$"]
for s in S:
    T.append(s)
    T.append("$")
T = "".join(T)

L = manacher_algorithm(T)

print(*[c - 1 if i % 2 == 0 else c - 1 for i, c in enumerate(L)][1:-1])

Test cases

Env Name Status Elapsed Memory
Python all_same_00 :heavy_check_mark: AC 691 ms 100 MB
Python all_same_01 :heavy_check_mark: AC 682 ms 99 MB
Python all_same_02 :heavy_check_mark: AC 668 ms 99 MB
Python all_same_03 :heavy_check_mark: AC 668 ms 99 MB
Python all_same_04 :heavy_check_mark: AC 696 ms 99 MB
Python example_00 :heavy_check_mark: AC 28 ms 11 MB
Python example_01 :heavy_check_mark: AC 28 ms 11 MB
Python example_02 :heavy_check_mark: AC 28 ms 11 MB
Python example_03 :heavy_check_mark: AC 28 ms 11 MB
Python max_random_00 :heavy_check_mark: AC 678 ms 37 MB
Python max_random_01 :heavy_check_mark: AC 685 ms 37 MB
Python max_random_02 :heavy_check_mark: AC 676 ms 37 MB
Python max_random_03 :heavy_check_mark: AC 676 ms 37 MB
Python max_random_04 :heavy_check_mark: AC 670 ms 37 MB
Python random_00 :heavy_check_mark: AC 535 ms 32 MB
Python random_01 :heavy_check_mark: AC 634 ms 35 MB
Python random_02 :heavy_check_mark: AC 101 ms 14 MB
Python random_03 :heavy_check_mark: AC 594 ms 34 MB
Python random_04 :heavy_check_mark: AC 395 ms 26 MB
Python small_00 :heavy_check_mark: AC 30 ms 12 MB
Python small_01 :heavy_check_mark: AC 29 ms 11 MB
Python small_02 :heavy_check_mark: AC 28 ms 11 MB
Python small_03 :heavy_check_mark: AC 30 ms 12 MB
Python small_04 :heavy_check_mark: AC 29 ms 12 MB
Back to top page