Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.027 s | 3 KBi |
#2 |
Correcto
|
0.026 s | 3 KBi |
#3 |
Correcto
|
0.031 s | 3 KBi |
#4 |
Correcto
|
0.022 s | 3 KBi |
#5 |
Correcto
|
0.023 s | 3 KBi |
#6 |
Correcto
|
0.023 s | 3 KBi |
#7 |
Correcto
|
0.07 s | 7 KBi |
#8 |
Correcto
|
0.098 s | 7 KBi |
#9 |
Correcto
|
0.062 s | 7 KBi |
#10 |
Correcto
|
0.055 s | 7 KBi |
#11 |
Correcto
|
0.067 s | 7 KBi |
#12 |
Correcto
|
0.059 s | 7 KBi |
#13 |
Correcto
|
0.069 s | 7 KBi |
#14 |
Correcto
|
0.062 s | 7 KBi |
#15 |
Correcto
|
0.065 s | 7 KBi |
#16 |
Correcto
|
0.073 s | 7 KBi |
#17 |
Correcto
|
0.052 s | 5 KBi |
#18 |
Correcto
|
0.055 s | 4 KBi |
#19 |
Correcto
|
0.086 s | 4 KBi |
#20 |
Correcto
|
0.071 s | 4 KBi |
#21 |
Correcto
|
0.046 s | 4 KBi |
#22 |
Correcto
|
0.052 s | 4 KBi |
def largest_border(s): i = 0 equal_borders = [0] * len(s) for j in range(1, len(s)): while s[i] != s[j] and i > 0: i = equal_borders[i - 1] if s[i] == s[j]: i = i + 1 equal_borders[j] = i return equal_borders[-1] s = input() print(largest_border(s))