# Submit Info #2674

Problem Lang User Status Time Memory
Z Algorithm pypy3 renoyu WA 161 ms 108.84 MiB

ケース詳細
Name Status Time Memory
example_00 WA 65 ms 31.90 MiB
example_01 WA 65 ms 31.89 MiB
example_02 WA 66 ms 31.94 MiB
example_03 WA 64 ms 31.89 MiB
random_00 WA 142 ms 91.28 MiB
random_01 WA 155 ms 105.47 MiB
random_02 WA 83 ms 38.61 MiB
random_03 WA 158 ms 91.88 MiB
random_04 WA 126 ms 74.00 MiB
random_05 WA 130 ms 90.20 MiB
random_06 WA 161 ms 108.84 MiB
random_07 WA 88 ms 48.78 MiB
random_08 WA 123 ms 73.30 MiB
random_09 WA 92 ms 55.64 MiB

import sys,collections as cl,bisect as bs sys.setrecursionlimit(100000) input = sys.stdin.readline mod = 10**9+7 Max = sys.maxsize def l(): #intのlist return list(map(int,input().split())) def m(): #複数文字 return map(int,input().split()) def onem(): #Nとかの取得 return int(input()) def s(x): #圧縮 a = [] aa = x[0] su = 1 for i in range(len(x)-1): if aa != x[i+1]: a.append([aa,su]) aa = x[i+1] su = 1 else: su += 1 a.append([aa,su]) return a def jo(x): #listをスペースごとに分ける return " ".join(map(str,x)) def max2(x): #他のときもどうように作成可能 return max(map(max,x)) def In(x,a): #aがリスト(sorted) k = bs.bisect_left(a,x) if k != len(a) and a[k] == x: return True else: return False """ def nibu(x,n,r): ll = 0 rr = r while True: mid = (ll+rr)//2 if rr == mid: return ll if (ここに評価入れる): rr = mid else: ll = mid+1 """ a = list(input())[:-1] ppp = [0 for i in range(len(a))] ppp[0] = len(a) i = 1 j = 0 while i < len(a): while i+j < len(a) and a[j] == a[i+j]: j += 1 ppp[i] = j if j == 0: i+=1 continue k = 1 while i+k < len(a) and k + ppp[k] < j: ppp[i+k] = ppp[k] k += 1 i += k j -= k print(ppp)