23A (Accepted)
This commit is contained in:
17
src/A. You're Given a String....py
Normal file
17
src/A. You're Given a String....py
Normal file
@@ -0,0 +1,17 @@
|
||||
# https://codeforces.com/problemset/problem/23/A
|
||||
|
||||
def solve():
|
||||
string = input()
|
||||
best = 0
|
||||
for offset in range(1, len(string)):
|
||||
for start in range(len(string)):
|
||||
i = 0
|
||||
while i + offset + start < len(string) and string[i + start] == string[i + offset + start]:
|
||||
i += 1
|
||||
|
||||
if i > best:
|
||||
best = i
|
||||
|
||||
print(best)
|
||||
|
||||
solve()
|
||||
Reference in New Issue
Block a user