Problem:


Score : 200 points

Problem Statement

We will call a string that can be obtained by concatenating two equal strings an even string.
For example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.

You are given an even string S consisting of lowercase English letters.
Find the length of the longest even string that can be obtained by deleting one or more characters from the end of S.
It is guaranteed that such a non-empty string exists for a given input.

Constraints

2 \leq |S| \leq 200

S is an even string consisting of lowercase English letters.

There exists a non-empty even string that can be obtained by deleting one or more characters from the end of S.

Input

Input is given from Standard Input in the following format:

S

Output

Print the length of the longest even string that can be obtained.

Sample Input 1

abaababaab

Sample Output 1

6

abaababaab itself is even, but we need to delete at least one character.

abaababaa is not even.

abaababa is not even.

abaabab is not even.

abaaba is even. Thus, we should print its length, 6.

Sample Input 2

xxxx

Sample Output 2

2

xxx is not even.

xx is even.

Sample Input 3

abcabcabcabc

Sample Output 3

6

The longest even string that can be obtained is abcabc, whose length is 6.

Sample Input 4

akasakaakasakasakaakas

Sample Output 4

14

The longest even string that can be obtained is akasakaakasaka, whose length is 14.



Sample input:
abaababaab


Sample output:
6

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 30, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode('utf8')
ans = 0
for i in range(2, len(S) + 1):
    ck = S[:-1 * i]
    if len(ck) % 2 == 0:
        if ck[:len(ck) // 2] == ck[len(ck) // 2:]:
            ans = len(ck)
            break
print(ans)

Submission status: Accepted

Solution code:
S = input()
for i in range(len(S)):
    S=S[:-1]
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        break

Submission status: Accepted

Solution code:
s=list(input())
while len(s) != 0:
  s.pop()
  if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]:
    print(len(s))
    exit()

Submission status: Accepted

Solution code:
s=str(input())[:-1]
while(True):
  i=len(s)//2
  if s[:i]==s[i:]:
    print(len(s))
    break
  else:
    s=s[:-1]

Submission status: Accepted

Solution code:
s=str(input())
c=0
while(True):
  if len(s)%2==1:
    s=s[:-2]
    continue
  i=len(s)//2
  if s[:i]==s[i:] and c!=0:
    print(len(s))
    exit()
  else:
    s=s[:-2]
    c+=1

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
s = input()
for i in range(1,len(s)-1):
	if (len(s) - i) % 2 == 1: pass
	elif s[:(len(s) - i)//2] == s[(len(s) - i)//2:-i]:
		print(len(s) - i)
		#print(s[:-i])
		break

Submission status: Accepted

Solution code:
def solve(s):
    for size in range(len(s) // 2 - 1, 0, -1):
        if s[:size] == s[size:2 * size]:
            return 2 * size
    return 0

_s = input()
print(solve(_s))

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s)):
    s = s[:-1]
    if(len(s)%2 == 0):
        j = len(s)//2
        if(s[:j] == s[j:]):
            print(len(s))
            break

Submission status: Accepted

Solution code:
S = str(input())
for i in range(len(S)):
    S=S[:-1]
    if len(S)%2==0:
        x=len(S)//2
        if S[:x] == S[x:]:
            print(len(S))
            break

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    s=STR()
    n=len(s)
    for i in range(1,len(s)):
        if (len(s)-i)%2==1:
            pass
        else:
            #print(i)
            temp1=s[0:(n-i)//2]
            temp2=s[(n-i)//2:n-i]
            #print(temp1)
            #print(temp2)
            if temp1==temp2:
                print(n-i)
                break
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
S = input()

for i in range(len(S)-2, -1, -1):
    if S[:i//2] == S[i//2:i]:
        print(i)
        break

Submission status: Accepted

Solution code:
list = list(str(input()))
while True:
    list.pop(-1)
    if len(list)%2==0:
        M=len(list)//2
        if list[0:M-1] == list[M:-1]:
            print(len(list))
            break

Submission status: Accepted

Solution code:
s=input()
l=len(s)//2-1
while True:
    s=s[:-2]
    if s[:l]==s[l:]:
        break
    l-=1
print(l*2)

Submission status: Accepted

Solution code:
# 要復習
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    s = list(input())
    
    s.pop()

    l = s[0:len(s)//2]
    r = s[len(s)//2:]

    while l != r:
        s.pop()
        l = s[0:len(s)//2]
        r = s[len(s)//2:]
        # print(s)
    print(len(s))
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#  AtCoder Beginners Contest 66 - B
# -*- encoding: UTF-8 -*-
slist = list(input())

slist.pop()

if len(slist) % 2 == 1:
  slist.pop()

result = 0
while len(slist) > 0 :
   l = int(len(slist) / 2)
#   print(slist)
#   print(l)
   flist = slist[0:l]
   rlist = slist[l:]
#   print(flist)
#   print(rlist)
   if "".join(flist) == "".join(rlist) :
      result = len(slist)
      break
   slist.pop()
   slist.pop()

print(result)

Submission status: Accepted

Solution code:
s = input()
while 1:
    s = s[:-2]
    if s[:len(s) // 2] == s[len(s) // 2:]:
        print(len(s))
        exit()

Submission status: Accepted

Solution code:
S = input()
while True:
    S = S[:-2]
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        break

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

for i in range(1, len(S)):
	T = S[:-2*i]
	if T[:len(T)//2] == T[len(T)//2:]:
		print(len(T))
		break

Submission status: Accepted

Solution code:
s = input()
s = s[:-1]

for _ in range(len(s)):
    
    if len(s) % 2 == 0:
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            exit()
    s = s[:-1]
print('Err')

Submission status: Accepted

Solution code:
#from fractions import gcd
#mod = 10 ** 9 + 7
#N = int(input())
#a = list(map(int,input().split()))
#a,b,c = map(int,input().split())
#ans = [0] * N

def intinput():
    return int(input())

def listintinput():
    return list(map(int,input().split()))

def splitintinput():
    return map(int,input().split())

S = input()
n = int(len(S)/2)
for i in range(1,n):
    if S[0:n-i] == S[n-i:2*n-2*i]:
        print((n-i)*2)
        break

Submission status: Accepted

Solution code:
S = input()

while 2 <= len(S):
    S = S[:len(S)-2]
    center = int(len(S)/2)

    if S[:center] == S[center:]:
        print(int(len(S)))
        break

Submission status: Accepted

Solution code:
s = input()
flag = -1
k = -1
for i in range(len(s)):
  flag += 1
  k += 1
  a = s[0:(len(s)-k)//2]
  b = s[(len(s)-k)//2:(len(s)-k)]
  if a == b:
    if flag != 0:
      print(len(a)+len(b))
      break

Submission status: Accepted

Solution code:
import sys
s=input()

for i in range(len(s)-1,1,-1):
    if s[:i] == s[:i//2] + s[:i//2]:
        print(i)
        sys.exit()

Submission status: Accepted

Solution code:
S = list(input())
answer = 0
while True:
    if len(S) >= 1:
        S.pop(-1)
        # print(S[0:len(S)//2])
        # print(S[len(S)//2+1:-1])
        if S[0:len(S)//2] == S[len(S)//2:-1]:
            answer = len(S)-1
            break
    else:
        break
    # print(S)
print(answer)

Submission status: Accepted

Solution code:
s=input()
ans = 0
for i in range(len(s)//2):
  if s[:i]==s[i:i*2]:
    ans=i*2
print(ans)

Submission status: Accepted

Solution code:
s = list(input())
y = list()

for i in range(2, len(s), 2):
	y = s[:-i]
	h = int(len(s[:-i]) // 2 )
	if y[:h] == y[h:]:
		print(len(y))
		exit()

Submission status: Accepted

Solution code:
strings = input()
length = len(strings)

ans = 0

for i in range(1,length):
    test_str = strings[:-i]
    if len(test_str) % 2 == 1:
        pass
    elif len(test_str) % 2 == 0:
        splitter = int(len(test_str) / 2)
        if test_str[splitter:] == test_str[:splitter]:
            if splitter > ans:
                ans = splitter*2

print(ans)

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def reverse_range(Large_a, Small_b, i):  # b < a ,  get [b, a)
    return range(Small_b, Large_a, -i)[::-1]  # range(a, b+1, -1)


def crange(a, b, i):
    return range(a, b + 1, i)


def reverse_crange(Large_a, Small_b, i):
    return range(Small_b, Large_a, -i)


# import math
# import string
# import fractions
# from fractions import Fraction
# from fractions import gcd

# def lcm(n,m):
#     return int(n*m/gcd(n,m))

# import re
# import array
# import copy
# import functools
# import operator

# import collections
# import itertools
# import bisect
# import heapq

# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace

# from queue import PriorityQueue as pq

# def reduce(p, q):
#     common = fractions.gcd(p, q)
#     return (p//common , q//common )
# from itertools import accumulate
# from collections import deque

# from operator import mul
# from functools import reduce

# def combinations_count(n, r):
#     r = min(r, n - r)
#     numer = reduce(mul, range(n, n - r, -1), 1)
#     denom = reduce(mul, range(1, r + 1), 1)
#     return numer // denom

# import random
# import time


def main():
    s = input().strip()
    lll = [i for i in range(1, len(s)-1)[::-2]]
    for i in lll:
        eprint("range", end=": ")
        eprint(lll)
        # closed_i = i + 1
        if s[0: i//2] == s[i//2: i]:
            print(i)
            return
        else:
            eprint("debug ", end=": ")
            eprint("false this time")
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def reverse_range(Large_a, Small_b, i):  # b < a ,  get [b, a)
    return range(Small_b, Large_a, -i)  # range(a, b+1, -1)


def crange(a, b, i):
    return range(a, b + 1, i)


def reverse_crange(Large_a, Small_b, i):
    return range(Small_b, Large_a, -i)


# import math
# import string
# import fractions
# from fractions import Fraction
# from fractions import gcd

# def lcm(n,m):
#     return int(n*m/gcd(n,m))

# import re
# import array
# import copy
# import functools
# import operator

# import collections
# import itertools
# import bisect
# import heapq

# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace

# from queue import PriorityQueue as pq

# def reduce(p, q):
#     common = fractions.gcd(p, q)
#     return (p//common , q//common )
# from itertools import accumulate
# from collections import deque

# from operator import mul
# from functools import reduce

# def combinations_count(n, r):
#     r = min(r, n - r)
#     numer = reduce(mul, range(n, n - r, -1), 1)
#     denom = reduce(mul, range(1, r + 1), 1)
#     return numer // denom

# import random
# import time


def main():
    s = input().strip()
    lll = [i for i in crange(len(s) - 2, 0, -2)]
    for i in crange(len(s) - 2, 0, -2):
        i=i-1
        eprint("crange", end=": ")
        eprint(lll)
        s = s[0:i]
        if s[0:i // 2] == s[i // 2 + 1:i]:
            print(i+1)
            return
        else:
            eprint("debug ", end=": ")
            eprint("false this time")
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = list(input())

if len(S) % 2 == 0:
  S.pop(-1)

while S[: len(S) // 2] != S[len(S) // 2 :]:
  S.pop(-1)

print(len(S))

Submission status: Accepted

Solution code:
s = input()
for i in range(2,len(s),2):
  half = len(s[:-i])//2
  if s[:half] == s[half:-i]:
    print(len(s[:-i]))
    exit()

Submission status: Accepted

Solution code:
s = input()
for i in range(2,len(s)+2,2):
  half = len(s[:-i])//2
  if s[:half] == s[half:-i]:
    print(len(s[:-i]))
    exit()

Submission status: Accepted

Solution code:
S = list(input())
l = len(S)
a = 1
for i in range(l) :
    del S[-1]
    ll = len(S)
    if ll % 2 == 0 :
        for j in range((ll)//2) :
            if S[j] == S[(ll)//2 + j] :
                continue
            else :
                a = 0
                break
    else :
        a = 0
    if a == 1 :
        break
    a = 1
print(len(S))

Submission status: Accepted

Solution code:
s=input()
for i in range(len(s)):
  s=s[:-1]
  if s[:len(s)//2]==s[len(s)//2:]:
    print(len(s))
    break
  else:
    pass

Submission status: Accepted

Solution code:
s = input()

for i in range(1,len(s)):
  if s[:((len(s)-i)//2)] == s[(len(s)-i)//2:(len(s)-i)]:
    print(len(s)-i)
    break

Submission status: Accepted

Solution code:
s = input()

while len(s) > 2:
    s = s[:-2]
    x = len(s) // 2
    if s[:x] == s[x:]:
        print(len(s))
        break

Submission status: Accepted

Solution code:
s = input()
ans = 0
l = len(s)

while True:
    s = s[:l-2]
    l -= 2
    if s[:l//2] == s[l//2:]:
        ans = l
        break

print(ans)

Submission status: Accepted

Solution code:
s = input()

m = 0
for i in range(len(s)-1, -1, -1):
    tmp = s[:-i]
    len_tmp = len(tmp)
    if len_tmp % 2 != 0:
        continue
    center = len_tmp // 2
    former = tmp[:center]
    latter = tmp[center:]
    if former == latter:
        m = max(m, len_tmp)
print(m)

Submission status: Accepted

Solution code:
n = input()
while len(n) > 0:
  n = n[:-2]
  if n[:len(n)//2] == n[len(n)//2:]:
    print(len(n))
    break

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
s=input().strip()
flg=True

s=s[:-2]
while len(s)>=2:
    for i in range(len(s)//2):
        if s[i]!=s[len(s)//2+i]:
            flg=False
    if flg:
        print(len(s))
        exit()
    s=s[:-2]
    flg=True

Submission status: Accepted

Solution code:


import numpy as np
import fractions as fra

def che(s):
    n=len(s)
    if(n%2==1):return 0
    for i in range(n//2):
        if(s[i]!=s[i+n//2]):
            return 0
    return 1

s=input()
ans=0
for i in range(len(s)):
    for j in range(i,len(s)):
        if(i==0 and j==len(s)-1):
            continue
        if(che(s[i:j+1])):
            ans=max(ans,j+1-i)

print(ans)

Submission status: Accepted

Solution code:
s=list(input())
a=list(set(s))
if len(a)==1:
    print(len(s)-2)
else:
    while True:
        del s[-2:]
        if s[:(len(s)//2)]==s[(len(s)//2):]:
            print(len(s))
            exit()

Submission status: Accepted

Solution code:
s = input()

for x in s:
   s = s[:-1]
   if (len(s) % 2 == 0):
      half = int(len(s) / 2)
      for i in range(0, half):
         if (s[i] != s[i+half]):
            break
      if (i == half - 1):
         print(len(s))
         exit()

Submission status: Accepted

Solution code:
s = input()

t = len(s)//2

for i in range(1,t):
  u = s[:-2*i]
  if u[:len(u)//2] == u[len(u)//2:]:
    print(len(u))
    exit()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

S = list(input().rstrip())
if len(S) % 2 == 0:
    S.pop()
    S.pop()
else:
    S.pop()
m = len(S) // 2
if S[:m] == S[m:]:
    print(len(S))
    sys.exit()
for i in range(len(S) // 2):
    S.pop()
    S.pop()
    m = len(S) // 2
    if S[:m] == S[m:]:
        print(len(S))
        sys.exit()

Submission status: Accepted

Solution code:
a=input()
n=len(a)
while True:
    a=a[:-1]
    n-=1
    if n%2==0:
        if a[:n//2]==a[n//2:]:
            print(n)
            exit()

Submission status: Accepted

Solution code:
s = input()
max_num = 0
for i in range(1, len(s)):
    if i % 2 == 0 and s[:i] == s[:int(i/2)] * 2:
        max_num = i
    
print(max_num)

Submission status: Accepted

Solution code:
s = list(input())

l = len(s) // 2

for i in range(1,len(s)//2):
    s.pop()
    s.pop()
    if s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        break

Submission status: Accepted

Solution code:
s=input()
while len(s)>2:
    s=s[:len(s)-2]
    indx=len(s)//2
    if s[0:indx] == s[indx:]:
        ans=len(s)
        break
print(ans)

Submission status: Accepted

Solution code:
#pypyでだすとどうだ？

s=input()
n=len(s)
ss=''

def even_strings(a):
  n=len(a)
  if n%2!=0:
    return False
  
  if a[0:n//2]==a[n//2:n]:
    return True
  else:
    return False

for i in range(n-1): #手前までやる､最後まではやらない 1文字以上だから
  ss+=s[i]
  if even_strings(ss):
    ret=i
    
print(ret+1)

Submission status: Accepted

Solution code:
s=input()
n=len(s)
ss=''

def even_strings(a):
  n=len(a)
  if n%2!=0:
    return False
  
  if a[0:n//2]==a[n//2:n]:
    return True
  else:
    return False

for i in range(n-1): #手前までやる､最後まではやらない 1文字以上だから
  ss+=s[i]
  if even_strings(ss):
    ret=i
    
print(ret+1)

Submission status: Accepted

Solution code:
s=str(input())
flag=0
for i in range(len(s)//2):
    if flag==0:
        s=s[:-2]
        for j in range(len(s)//2):
            if s[j]!=s[(len(s)//2)+j]:
                break
            elif s[j]==s[(len(s)//2)+j] and j==(len(s)//2)-1:
                print(len(s))
                flag=1
                break

Submission status: Accepted

Solution code:
S = [c for c in input()]
while len(S):
    S.pop()
    if len(S) % 2 == 0 and S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        exit()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

s = input()

def check(txt):
    if len(txt)%2==1:
        return False
    else:
        half = len(txt)//2
#        print(txt[:half])
#        print(txt[half:])
        
        if txt[:half] == txt[half:]:
            return True
        else:
            return False

c = len(s)
while True:
    c -= 1
    txt = s[:c]
#    print(txt)

    if check(txt):
        print(len(txt))
        break

Submission status: Accepted

Solution code:
s = list(str(input()))

for _ in range(len(s)//2-1):
    del s[-2:]
    cnt = 0

    for i in range(len(s)//2):
        if s[i]==s[len(s)//2+i]:
            cnt += 1

    if cnt==len(s)//2:
        break

print(len(s))

Submission status: Accepted

Solution code:
s = input()
s = s[:-2]
while False in [s[i]==s[i+len(s)//2] for i in range(len(s)//2)]:
    s = s[:-2]
print(len(s))

Submission status: Accepted

Solution code:
s=str(input())
# print(s)
List=list(s)
List.pop(-1)
# print(List)
ans=0
for i in range((len(List)//2)+1):
    R=List[0:i]
    L=List[i:i+len(R)]
    # print("L",L,"R",R)
    if(R==L):
        # print(i,i+1,R,L)
        ans=len(R)*2

print(ans)

Submission status: Accepted

Solution code:
s=[i for i in input()]
del s[-1]
while len(s)>1:
  l=len(s)
  if l%2!=0:
    del s[-1]
    continue
  if s[0:l//2]==s[l//2:]:
    print(l)
    break
  else:
    del s[-1]

Submission status: Accepted

Solution code:
s = list(str(input()))

for i in range(10**18):
    s.pop()
    if len(s)%2:
        continue
    else:
        for j in range(len(s)//2):
            if s[j] != s[j+len(s)//2]:
                break
        else:
            print(len(s))
            exit(0)
            continue

Submission status: Accepted

Solution code:
s=input()
for i in range(len(s)):
    s=s[:-2]
    if s[:len(s)//2]==s[len(s)//2:]:
        print(len(s))
        break

Submission status: Accepted

Solution code:
s=list(input())

for i in range(1,len(s)):
    if (len(s)-i)%2==0:
        a=0
        for j in range((len(s)-i)//2):
            if s[j]!=s[j+(len(s)-i)//2]:
                a+=1
        if a==0:
            print(len(s)-i)
            break

Submission status: Accepted

Solution code:
s=list(input())


while True:
        s.pop(-1)
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            break

Submission status: Accepted

Solution code:
S=input()
S=S[0:-2]
while S[0:int(len(S)/2-1)]!=S[int(len(S)/2):len(S)-1]:
    S=S[0:-2]
print(len(S))

Submission status: Accepted

Solution code:
S = input()

for i in range(1, len(S)):
    s = S[:-i]
    n = len(s)
    if n % 2 == 1:
        continue
    a = s[:n // 2]
    b = s[n // 2:]
    if a == b:
        print(n)
        break

Submission status: Accepted

Solution code:
import sys

S = (input())

l = len(S)//2
if len(S)==2:
    if S[0]==S[1]:
        print(len(S))
        sys.exit()
for i in range(l):
    S = S[0:len(S)-2]
    a = S[0:len(S)//2]
    b = S[len(S)//2:]

    if a==b:
        print(len(S))
        sys.exit()

Submission status: Accepted

Solution code:

s = list(input())

#偶文字列かどうかの判定
for i in range(len(s)):
    s.pop()
    if len(s) % 2 != 0:
        pass
    else:
        if s == s[:len(s)//2] * 2:
            break

print(int(len(s)))

Submission status: Accepted

Solution code:

s = list(input())

#偶文字列かどうかの判定
for i in range(len(s)):
#    print(s)
    s.pop()
#    print(s)
    if len(s) % 2 != 0:
        pass
    else:
        if s == s[:len(s)//2] * 2:
            break

print(int(len(s)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#H, W = map(int, input().split())
#S = list(map(int, input().split()))
#N = int(input())
S = str(input())

if len(S)%2 == 1 :
  S = S[0:-1]
else :
  S = S[0:-2]

while (True) :
  if S[0:len(S)//2] == S[len(S)//2:] :
    print (len(S))
    exit()
  else :
    S = S[0:-2]

Submission status: Accepted

Solution code:
#S = list(map(str, input()))
S = input()

S = S[0:len(S)-1]
if len(S) % 2 == 0:
    while True:
        if len(S) == 2:
            if S[0] == S[1]:
                print(2)
                exit()
            else:
                print(1)
                exit()
            
        left = S[0:len(S)//2]
        right = S[len(S)//2:len(S)]
        if left == right:
            print(len(S))
            exit()
        else:
            S = S[0:len(S)-2]
else:
    S = S[0:len(S)-1]
    while True:
        if len(S) == 2:
            if S[0] == S[1]:
                print(2)
                exit()
            else:
                print(1)
                exit()
            
        left = S[0:len(S)//2]
        right = S[len(S)//2:len(S)]
        if left == right:
            print(len(S))
            exit()
        else:
            S = S[0:len(S)-2]

Submission status: Accepted

Solution code:
s=input()
for i in range(1,len(s)):
  if s[:(-i*2)] == s[:(len(s)-2*i)//2]*2:
    print(len(s[:-i*2]))
    break

Submission status: Accepted

Solution code:
S=list(input())
while True:
  S.pop(-1)
  if len(S)%2==0:
    h=len(S)//2
    if len(S)==0 or S[:h]==S[h:]:
      print(len(S))
      break

Submission status: Accepted

Solution code:
s=input()
maxlen=0
for i in range(len(s)):
  ss=s[:-i]
  if ss[:len(ss)//2]==ss[len(ss)//2:]:
    maxlen=(max(len(ss),maxlen))
print(maxlen)

Submission status: Accepted

Solution code:
s=input()
l=len(s)
for i in range(1,l//2):
    k=(l-i*2)
    #print(s[:k//2])
    #print(s[k//2:k])
    if s[:k//2]==s[k//2:k]:
        print(k)
        break

Submission status: Accepted

Solution code:
s=input()[:-1]
while True:
    if len(s) % 2 == 0:
        # 半分を基準とした前後が一致しているか
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            break
    s = s[:-1]

Submission status: Accepted

Solution code:
S=str(input())
answer=0
for i in range(len(S)//2-1):
  T=S[:i+1]*2
  if S[:2*i+2]==T:
    answer=2*(i+1)
print(answer)

Submission status: Accepted

Solution code:
S = list(input())

S.pop()

while True:
    l = len(S)//2
    if S[:l] == S[l:]:
        break
    else:
        S.pop()

print(len(S))

Submission status: Accepted

Solution code:
s = input()
ls = len(s)
for i in range(ls//2-1, 0, -1):
    if s[:i] == s[i:2*i]:
        print(2*i) 
        exit()

Submission status: Accepted

Solution code:
S = input()

S = S[:-2]
while S[:len(S)//2] != S[len(S)//2:]:
  S = S[:-2]
print(len(S))

Submission status: Accepted

Solution code:
S = input()


while len(S) != 0:
    S = S[:-1]
    l = len(S)*0.5
    if l.is_integer():
        l = int(l)
        if S[l:] == S[:l]:
            print(l*2)
            break

Submission status: Accepted

Solution code:
S = input()
while 1:
    S = S[:-2]
    if S[:len(S)//2] == S[len(S)//2:]:
        break
print(len(S))

Submission status: Accepted

Solution code:
S = input()

listS = list(S)
ans = []
for i in range(len(S)):
    listS.pop(-1)
    if len(listS) % 2 == 0 and  (listS[0:int((len(listS))/2)]) == (listS[int((len(listS))/2):]):
        ans.append(len(listS))

    
    
print(max(ans))

Submission status: Accepted

Solution code:
S = input()
N = len(S)

for i in range(2, 300, 2):
  T = S[:-i]
  if T[:(N - i) // 2] == T[(N - i) // 2:]:
    print(N - i)
    exit()

Submission status: Accepted

Solution code:
S = list(input())

while len(S) > 1:
    S.pop()
    if len(S) % 2 == 0 and S[:len(S) // 2] == S[len(S) // 2:]:
        print(len(S))
        break

Submission status: Accepted

Solution code:
import sys

s = sys.stdin.readline().rstrip()

def main():
    l = len(s)
    t = s[:-1] if l & 1 else s
    l = len(t)
    while True:
        t = t[:-2]
        l -= 2
        if t[:l//2] * 2 == t:
            return l

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
s = input()

for i in range(1,len(s)):
    a = s[:(len(s) - i) // 2]
    b = s[(len(s) - i) // 2: len(s) - i]
    if a == b:
        print(len(s) - i)
        import sys
        sys.exit()

Submission status: Accepted

Solution code:
s = input()

for i in range(1, len(s)):
    tmp = s[:-i]
    l = len(tmp) // 2
    if tmp[:l] == tmp[l:]:
        print(len(tmp))
        break

Submission status: Accepted

Solution code:
s=input()
for i in range(len(s)):
    s=s[:-1]
    if len(s)%2==0 and s[0:len(s)//2]==s[len(s)//2:len(s)]:
        break
print(len(s))

Submission status: Accepted

Solution code:
s = input()
for k in range(len(s)//2-1, 0, -1):
  if s[:k] == s[k:2*k]: break
print(k*2)

Submission status: Accepted

Solution code:
s = input()
for i in range(1, len(s)):
    back = len(s) - i
    if back % 2 == 0 and s[:back // 2] == s[back // 2:back]:
        print(len(s[:back]))
        exit()

Submission status: Accepted

Solution code:
s=list(input())
num=(len(s)-2)//2
def moji(s): #偶文字列か調べる
    c=0
    half=len(s)//2
    for i in range(half):
        if s[i]!=s[i+half]:
            c=1
            break
    return c

exit=0
for i in range(num):
    del s[-1]
    del s[-1]
    check=moji(s)
    if check==0: #偶文字列の場合
        exit=1
        break
print(len(s))
#print(len(s) if exit==1 else 1)

Submission status: Accepted

Solution code:
s=list(input())
num=(len(s)-2)//2
def moji(s): #偶文字列か調べる
    c=0
    half=len(s)//2
    for i in range(half):
        if s[i]!=s[i+half]:
            c=1
            break
    return c

exit=0
for i in range(num):
    del s[-1]
    del s[-1]
    check=moji(s)
    if check==0: #偶文字列の場合
        exit=1
        break
print(len(s) if exit==1 else 1)

Submission status: Accepted

Solution code:
s = str(input())

for i in range(1, len(s)):
    s_del = s[:(-1)*i]
    if len(s_del) % 2 == 1:
        continue
    else:
        half = int(len(s_del) / 2)
        if s_del[:half] == s_del[half:]:
            ans = len(s_del)
            break

print(ans)

Submission status: Accepted

Solution code:
s = input()
s = s[:-2] if len(s) % 2 == 0 else s[:-3]
for i in range(len(s),0,-2):
    if s[:i//2] == s[i//2:]:
        ans = i
        break
    else:
        s = s[:-2]
    
print(ans)

Submission status: Accepted

Solution code:
S = input()
N = len(S)

for i in range(1, N):
    t = (S[:-1 * i])
    l = len(t)
    if t[:l//2] == t[l//2:]:
        break

print(l)

Submission status: Accepted

Solution code:
s = input()

ans = 0
for i in range(len(s)):
    s2 = s[:i]

    # check
    f = True
    if len(s2) % 2 == 1:
        f = False
    else:
        for i in range(len(s2) // 2):
            if s2[i] != s2[i + len(s2) // 2]:
                f = False
    if f:
        ans = max(ans, len(s2))
print(ans)

Submission status: Accepted

Solution code:
s = input()
n = len(s)

def check(s):
    n = len(s)
    if n%2 == 0:
        if s[:n//2] == s[n//2:]:
            return True
        else:
            return False
    else:
        # 偶数のぐう文字列は存在しない
        return False

for i in range(n):
    if i != 0 and check(s):
        break
    s = s[:-1]
    
print(len(s))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    s=input()
    for w in range((len(s)-1)//2,0,-1):
        if s[:w]==s[w:w*2]:
            print(w*2)
            break

main()

Submission status: Accepted

Solution code:
s=input()
flag=0
for i in range(1, len(s)//2+1):
    p=s[:-2*i]
    if p[:len(p)//2]==p[len(p)//2:]:
        print(len(p))
        flag=1
        break
    if flag:
        break
    else:
        continue

Submission status: Accepted

Solution code:
s = input()
for i in range(2, len(s)+1, 2):
    s2 = s[:-i]
    s2len = len(s2)
    if s2[:s2len//2] == s2[s2len//2:]:
        print(s2len)
        break

Submission status: Accepted

Solution code:
s=input()
ans=0
s=s[:-1]
for i in range(len(s)):
    if len(s)%2==0:
        if s[:len(s)//2]==s[len(s)//2:]:
            ans=max(len(s),ans)
            
        else:
            s=s[:-2]
    else:
        s=s[:-1]
print(ans)

Submission status: Accepted

Solution code:
s=input()
while True:
    s=s[:-1]
    if(len(s)%2==0):
        if(s[:len(s)//2]==s[len(s)//2:]):
            print(len(s))
            exit()

Submission status: Accepted

Solution code:
S = list(input())
S.pop(-1)
while True:
    if len(S)%2 != 0:
        S.pop(-1)
    c = 0
    for i in range(len(S)//2):
        if S[i] != S[i+len(S)//2]:
            c = 1
            del S[-2:]
            break
    if c == 0:
        break
print(len(S))