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: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = list(iss())
    S = S[:-1]
    for _ in range(len(S)):
        l = len(S)
        if l % 2 == 0 and S[:l // 2] == S[l // 2:]:
            print("".join(S))
            exit()
        else:
            S = S[:-1]


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections
#n = int(input())
#a = list(map(int, input().split()))
#h, w = list(map(int, input().split()))
s = input()
for i in range(1, len(s)):
    a = collections.Counter(s[0:-i])
    even = True
    for j in a.values():
        if j%2!=0:
            even=False
    
    if even:
        print(len(s[0:-i]))
        exit()


    #print(a)

Submission status: Wrong Answer

Solution code:
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

# Written by NoKnowledgeGG @YlePhan

#import math
#mod = 10**9+7



def main():
  s = input()
  s_l = len(s)
  L = list(set(list(s)))
  #print(L) ('a','b')
  L_l = len(L)
  comp = s[:s_l - 1]# first not comparable
  for i in range(s_l-1):
    i = 1
    for j in range(L_l): 
      if comp.count(L[j]) % 2 == 0:
        if i == len(L):
          print(len(comp))
          exit()
        else:
          i += 1
      else:
        comp = comp[:len(comp)-1]
  print(0)
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

# Written by NoKnowledgeGG @YlePhan

#import math
#mod = 10**9+7



def main():
  s = input()
  s_l = len(s)
  L = list(set(list(s)))
  #print(L) ('a','b')
  L_l = len(L)
  comp = s[:s_l - 1]# first not comparable
  for i in range(s_l-1):
    i = 1
    for j in range(L_l): 
      if comp.count(L[j]) % 2 == 0:
        if i == len(L):
          print(len(comp))
          exit()
        else:
          i += 1
      else:
        comp = comp[:len(comp)-1]
  
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

maxlen = 0
for i in range(length//2-1):
  if s[0:(i+1)] == s[(i+1):2*(i+1)]:
    maxlen = 2*i
    
print(maxlen)

Submission status: Wrong Answer

Solution code:

import math
import itertools
import statistics
#import numpy as np
import collections

#n = int(input())
#a, b, c, d = list(map(int, input().split()))
s = input()
for i in range(1, len(s)):
    a = collections.Counter(s[0: -i])
    even = True
    for v in a.values():
        if v%2!=0:
            even = False
            break
    
    if even:
        print(len(s)-i)
        exit()

Submission status: Wrong Answer

Solution code:

import math
import itertools
import statistics
#import numpy as np
import collections

#n = int(input())
#a, b, c, d = list(map(int, input().split()))
s = input()
for i in range(1, len(s)+1):
    a = collections.Counter(s[0: -i])
    even = True
    for v in a.values():
        if v%2!=0:
            even = False
            break
    
    if even:
        print(len(s)-i)
        exit()

Submission status: Wrong Answer

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

for i in range(n//2):
  if i != 0:
    if s[0:n//2-i] == s[n//2-i:n-2*i]:
      print(n-2*i)

Submission status: Wrong Answer

Solution code:
s = list(input())

if len(s) %2 == 1:
  s.pop(-1)
else:
  s.pop(-1)
  s.pop(-1)

while len(s) != 0:
  l = len(s)
  if s[:l//2] == s[l//2:]:
    print(l)
  s.pop(-1)
  s.pop(-1)

Submission status: Wrong Answer

Solution code:
s = list(input())

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

while len(s) != 0:
  l = len(s)
  if s[:l//2] == s[l//2:]:
    print(l)
  s.pop(-1)
  s.pop(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
for i in range(1,n+1):
  if s[0:i]==s[i:i+i]:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
for d in range(1,N-1):
    if (N-d)&1: continue
    for i in range(N-d):
        if S[i] != S[-1-d-i]: break
    else:
        print(N-d)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())

def check(L):
    if len(L)%2 != 0:
        return False
    
    n = int(len(L)/2)
    if L[:n] == L[n:]:
        #print(L[:n],L[n:])
        return True


#print(check(s))

for i in range(1,len(s)):
    m = len(s) - i
    if check(s[0:m]):
        print(m)

Submission status: Wrong Answer

Solution code:
a=input()
l=len(a)
while l>0:
 # print(l)
  if l%2!=0:
    l -= 1
    a = a[:-1]
#    print(a)
  else:
    t =int(l/2)
    if a[0:t] == a[t:]:
      print(l)
      break
    else:
      l -= 1

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: str):
    for i in reversed(range(1, len(S) // 2)):
        if S[:i] == S[i:2 * i]:
            print(2 * i)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
s = s[:-2]
for _ in range(n):
  n = len(s)
  m = int(n/2)
  if s[:m] == s[m:]:
    print(s)
    break
  else:
    s = s[:-2]

Submission status: Wrong Answer

Solution code:
S=input()
T=S[:-1]
for i in range(len(T)):
	K=T[:-i]
	if len(K)%2==0:
		count=0
		M=len(K)//2
		for j in range (M):
			if K[j]==K[j+M]:
				count+=1
		if count==M and M!=0:
			print(M*2)

Submission status: Wrong Answer

Solution code:
s=input().strip()
for i in range(1000):
  r=-2*i
  s2 = s[:r]
  half=len(s2)//2
  if s2[half:]==s2[:half*-1]:
    print(r)

Submission status: Wrong Answer

Solution code:
l=list(input())
for i in range(len(l)):
            del l[-1]
            if len(l)%2!=0:
                        del l[-1]
                        #print('1',l)
            if len(l)%2==0:
                        if l[:len(l)//2]==l[len(l)//2:]:
                                    #print('2',l,'len(l)',len(l))
                                    exit()
                        else:
                                    del l[-1]
                                    #print('3',l)

Submission status: Wrong Answer

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

if search <= 2:
    print(0)
    exit()

while search > 2:
    if search % 2 == 0:
        if s[0:search//2] == s[search//2:search]:
            ans = max(ans, search)
    else:
        pass
    search -= 1
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

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

Submission status: Wrong Answer

Solution code:
import numpy as np

S = str(input())

import numpy as np

for i in range(int(np.floor(len(S)/2))):
    j = int(np.floor(len(S)/2)) - i
    first_str = S[:j]
    second_str = S[j:2*j]
    if first_str == second_str:
        num = 2*j
        break

print(num)

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    s = input()

    for i in range(len(s)-1, 1, -1):
        if i % 2 == 1:
            continue
        else:
            if s[0:i//2] == s[i//2:i]:
                print(str(i))

Submission status: Wrong Answer

Solution code:
s = input()

r = 0
while len(s) > 0:
  s = s[:-2]
  print(s)
  print(s[:int(len(s)/2)])
  print(s[int(len(s)/2):])
  print("--")
  if s[:int(len(s)/2)] == s[int(len(s)/2):]:
    r = len(s)
    break
    
print(r)

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
for j in range(1,N//2):
    M=N-2*j
    c=0
    for i in range(M//2):
        if S[i]==S[i+M//2]:
            c=c+1
            if c==M//2:
                print(M)
                break
    else:
        continue

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
for j in range(1,N//2+1):
    M=N-2*j
    c=0
    for i in range(M//2):
        if S[i]==S[i+M//2]:
            c=c+1
            if c==M//2:
                print(M)
                break

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
for j in range(1,N//2+1):
    M=N-2*j
    c=0
    for i in range(M//2):
        if S[i]==S[i+M//2]:
            c=c+1
            if c==M//2:
                print(M)
                break
    else:
        continue

Submission status: Wrong Answer

Solution code:
A = list(input())

while A:
    count = 0
    length = len(A)
    half = length // 2
    for i in range(half):
        if A[i] == A[half + i]:
            count += 1
        if i == half - 1: break
        
    if count != 0: break
    
    A = A[:-2]
    
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
num=len(s)
for i in range(1,len(s)):
    s=s[:-1]
    a=s[:int(len(s)/2)]
    b=s[int(len(s)/2):]
    if a==b:
        num=min(num,len(s))
print(num)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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]))

Submission status: Wrong Answer

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(s)
        exit()
    s=s[:-2]
    flg=True

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
s=input().strip()
flg=True
while len(s)>=2:
    for i in range(len(s)):
        if s[i]!=s[-i-1]:
            flg=False
    if flg:
        print(s)
        exit()
    s=s[:-2]
    flg=True

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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[:len(S)//2]))
        exit()

Submission status: Wrong Answer

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[:len(S)//2+1]))
        exit()

Submission status: Wrong Answer

Solution code:
s = input()
if len(s) > 2:
    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))
if len(s) == 2:
    print(1)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
s=list(input())
if len(s)==2:
    print(1)
else:
    for i in range(2,len(s),2):
        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)

Submission status: Wrong Answer

Solution code:
s=list(input())

for i in range(2,len(s),2):
    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)

Submission status: Wrong Answer

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)-1]
    if len(S)%2!=0:
        continue
    a = S[0:len(S)//2]
    b = S[len(S)//2:]

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

Submission status: Wrong Answer

Solution code:
import sys

S = list(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)-1]
    if len(S)%2!=0:
        continue
    a = S[0:len(S)//2]
    b = S[len(S)//2:]
    if a==b:
        print(len(S))
        sys.exit()

Submission status: Wrong Answer

Solution code:
import sys

S = list(input())

l = len(S)//2

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

Submission status: Wrong Answer

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:
            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:
            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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())
l = [str(x) for x in list(str(S))]
for i in range(int(len(l)/2)):
    l.pop(-1)
    if len(l) % 2 == 0:
        tmp = "".join(l)
        if tmp[:int(len(l)/2)] == tmp[int(len(l)/2):]:
            print(len(l))
            break
        else:
            continue
    elif len(l) == 1:
        print(0)
    else:
        continue

Submission status: Wrong Answer

Solution code:
S = str(input())
l = [str(x) for x in list(str(S))]
for i in range(int(len(l)/2)):
    l.pop(-1)
    if len(l) % 2 == 0:
        tmp = "".join(l)
        if tmp[:int(len(l)/2)] == tmp[int(len(l)/2):]:
            print(len(l))
            break
        else:
            continue
    else:
        continue

Submission status: Wrong Answer

Solution code:
S=input()

buf=list(S)

result=0

for i in range(len(S)):
    del buf[-1]
    print(buf)
    if(len(buf)%2==0):
        tmp="".join(buf[0:int(len(buf)/2)])
        print(tmp)
        if "".join(buf).count(tmp)==2:
            result=len(buf)
            break

print(result)

Submission status: Wrong Answer

Solution code:
S=input()

buf=list(S)

result=0

for i in S[-1::-1]:
    buf.remove(i)
    if(len(buf)%2==0):
        tmp="".join(buf[0:int(len(buf)/2)])
        if S.count(tmp)==2 or len(tmp) == 1:
            result=len(buf)
            break

print(result)

Submission status: Wrong Answer

Solution code:
S=input()

buf=list(S)

result=0

for i in S[-1::-1]:
    buf.remove(i)
    if(len(buf)%2==0):
        tmp="".join(buf[0:int(len(buf)/2)])
        if S.count(tmp)==2:
            result=len(buf)
            break

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()[:-1]
if len(s) == 0:
    print(0)
    quit()
for i in range(len(s) - 1, -1, -1):
    if i % 2 == 0:
        continue
    l = i // 2 + 1
    if s[: l] == s[l : i + 1]:
        print(2 * l)

Submission status: Wrong Answer

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

for i in range(len(s) - 1, -1, -1):
    if i % 2 == 0:
        continue
    l = i // 2 + 1
    if s[: l] == s[l : i + 1]:
        print(2 * l)

Submission status: Wrong Answer

Solution code:
S=input()

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

Submission status: Wrong Answer

Solution code:
S=input()

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

Submission status: Wrong Answer

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

for i in range(l // 2):
    T = S[:l - i - 1]
    t_len = len(T)
    if t_len % 2 == 0:
        size = t_len // 2
        if T[:size] == T[size:]:
            ans = t_len
            break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
len_s = len(S)
for i in range(2, len_s, 2):
    deleted_str = S[:-i]
    center = (len_s - i) // 2
    mae = deleted_str[:center]
    ato = deleted_str[center:]
    if mae == ato:
        print(len(deleted_str))

Submission status: Wrong Answer

Solution code:
S = input()
min = 10**3
len_s = len(S)
for i in range(2, len_s, 2):
    deleted_str = S[:-i]
    center = (len_s - i) // 2    # print(deleted_str)
    if deleted_str[:center] == deleted_str[center:]:
        print(len(deleted_str))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
ol = list()
for i in range(len(s) - 1):
    if s[0:i:1] * 2 == s[0:i * 2:1]:
        ol.append(len(s[0:i]))
    else:
        pass
print(max(ol))

Submission status: Wrong Answer

Solution code:
s = input()
ol = list()
for i in range(len(s) - 1):
    if s[0:i:1] * 2 == s[0:i * 2:1]:
        ol.append(len(2 * s[0:i]))
    else:
        pass
print(max(ol))

Submission status: Wrong Answer

Solution code:
S = list(input())
if len(S)%2 != 0:
    S.remove(S[-1])
else:
    S.remove(S[-1])
    S.remove(S[-1])
while S[:int(len(S)/2)] != S[int(len(S)/2):]:
    S.remove(S[-1])
    S.remove(S[-1])
print(len(S))

Submission status: Wrong Answer

Solution code:
def even(s):
    if len(s)%2==1:
        return False
    m=len(s)//2
    for i in range(m):
        if s[i]!=s[m+i]:
            return False
    return True

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

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(-1, -len(s)+1, -1):
    flag = 0
    _s = s[:i]
    for __s in set(_s):
        if _s.count(__s)%2 == 0:
            flag += 1

    if flag == len(set(_s)):
        print(len(_s))
        break

Submission status: Wrong Answer

Solution code:
S = list(input())
S.pop(-1)
if len(S) % 2 != 0:
    S.pop(-1)
while True:
    tmp = set()
    for i in S:
        tmp ^= {i}
    if tmp == set():
        break
    S.pop(-1)
    S.pop(-1)
print(len(S))

Submission status: Wrong Answer

Solution code:
S=list(input())
print(S)

lenS=len(S)
print(lenS)
ans=0

if lenS%2==0:
  for l in range(lenS//2-1):
    check=0
    for k in range(l+1):
      if S[k]==S[k+l+1]:
        check+=1
    if check==l+1:
      ans=check*2
  print(ans)

else:
  for l in range(lenS//2):
    check=0
    for k in range(l+1):
      if S[k]==S[k+l+1]:
        check+=1
    if check==l+1:
      ans=check*2
  print(ans)

Submission status: Wrong Answer

Solution code:
# B - ss
S = str(input())
count = 0
ans_s = S[:-1]

while count <= len(ans_s):
    len_a = int(len(ans_s)/2)
    if len(ans_s) % 2 != 0:
        ans_s = ans_s[:-1]
        count += 1
    elif ans_s[:len_a] == ans_s[len_a:]:
        print(len(ans_s))
        exit()
    else:
        ans_s = ans_s[:-1]
        count += 1

Submission status: Wrong Answer

Solution code:
import collections

def even_str(cnt):
  return len([key for key in cnt if cnt[key] % 2 != 0]) == 0


s = list(input())
c = collections.Counter(s)

while len(s) > 1:
  last_char = s.pop(-1)
  c[last_char] -= 1
  if(even_str(c)):
    print(len(s))
    exit()
print(1)

Submission status: Wrong Answer

Solution code:
# B - ss
S = str(input())
count = 0
ans_s = S[:-1]

while count <= len(ans_s):
    len_a = int(len(ans_s)/2)
    if len(ans_s) % 2 != 0:
        ans_s = ans_s[:-1]
        count += 1
    elif ans_s[:len_a] == ans_s[len_a:]:
        print(len(ans_s))
        exit()
    else:
        ans_s = ans_s[:-1]
        count += 1

Submission status: Wrong Answer

Solution code:
import collections

def even_str(cnt):
  return len([key for key in cnt if cnt[key] % 2 != 0]) == 0

s = list(input())
c = collections.Counter(s)

while len(s) != 0:
  last_char = s.pop(-1)
  c[last_char] -= 1
  if(even_str(c)):
    print(len(s))
    exit()
print(1)

Submission status: Wrong Answer

Solution code:
import collections

def even_str(cnt):
  return len([key for key in cnt if cnt[key] % 2 != 0]) == 0


s = list(input())
c = collections.Counter(s)

while len(s) != 0:
  last_char = s.pop(-1)
  c[last_char] -= 1
  if(even_str(c)):
    print(len(s))
    exit()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(int(1e6))

S = input()

ans = 0
for n in range(len(S)-1, 2, -1):
  if n % 2:
    continue
  s = S[0:n]
  m = n // 2
  if s[0:m] == s[m:n]:
    #print(s, n, m, s[0:m])
    ans = n
    break
  
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in s:
    if all(s.count(x)%2 == 0 for x in s) or len(s) == 2:
        print(len(s))
        break
    else:
        s=s[:-1]

Submission status: Wrong Answer

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

for i in s:
    if all(s.count(x)%2 == 0 for x in s):
        print(len(s))
        break
    else:
        s=s[:-1]

Submission status: Wrong Answer

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

while s!=s_inv or len(s)%2!=0:
  s = s[:-1]
  s_inv = s[::-1]

print(len(s))

Submission status: Wrong Answer

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

while s != s_inv:
  s = s[:-1]
  s_inv = s[::-1]

print(len(s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()

for i in reversed(range(len(S))):
  if i % 2 == 1:
    moji1 = S[0:i//2 + 1]
    moji2 = S[i//2 + 1: i+ 1]
    if moji1==moji2:
      print(i+1)
      break

Submission status: Wrong Answer

Solution code:
S = input()

LengthS = len(S)
for i in range(3):
    LengthS = LengthS - 2
    HalfS = int(LengthS / 2)
    if S[:HalfS] == S[HalfS:LengthS]:
        print(LengthS)
        break

Submission status: Wrong Answer

Solution code:
def ss(s):
    print(s)
    return s[:len(s)//2] == s[len(s)//2:]

S = input()
N = len(S)
for i in range(1, N-1):
    if ss(S[:N-i]):
        ans = N-i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
def ss(s):
    return s[:len(s)//2] == s[len(s)//2:]

S = input()
N = len(S)
ans = 0
for i in range(1, N-1):
    if ss(S[:N-i]):
        ans = N-i
print(ans)

Submission status: Wrong Answer

Solution code:
s=list(input())

def ans(s):
    n=len(s)//2
    f=0
    for i in range(n):
        if s[i]!=s[i+n]:
            f+=1
            break
    if f==0:
        return True
    else:
        return False
      
s.pop(-1)
s.pop(-1)
kai=2
while not ans(s):
    s.pop(-1)
    s.pop(-1)
    kai+=2
print(kai)

Submission status: Wrong Answer

Solution code:
import collections
S = list(input())
for i in range(len(S)-2,1,-2):
  S = S[:len(S)-2]
  countS = collections.Counter(S)
  for j in countS.values():
    if j%2 != 0:
      break
  else:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
import collections
S = list(input())
for i in range(len(S)-2,1,-2):
  S = S[:len(S)-2]
  for j in collections.Counter(S).values():
    if j%2 != 0:
      break
  else:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
import collections
S = input()
for i in range(len(S)-2,1,-2):
  S = S[:len(S)-2]
  for j in collections.Counter(S).values():
    if j%2 != 0:
      break
  else:
    print(i)
    break
else:
  print(0)

Submission status: Wrong Answer

Solution code:
import collections
S = input()
for i in range(len(S)-2,-1,-2):
  S = S[:len(S)-2]
  for j in collections.Counter(S).values():
    if j%2 != 0:
      break
  else:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
import collections
S = input()
for i in range(len(S)-2,1,-2):
  S = S[:len(S)-2]
  for j in collections.Counter(S).values():
    if j%2 != 0:
      break
  else:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
import collections
S = input()
for i in range(len(S)-1,1,-1):
  S = S[:len(S)-1]
  for j in collections.Counter(S).values():
    if j%2 != 0:
      break
  else:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
S = list(input())
while S:
  del S[-2:]
  T = S[::-1]
  if T == S:
    print(len(T))
    exit()
  S = T[::-1]