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:
def ss(S: str)->int:
    n = len(S)
    ret = 0
    for i in range(n//2-2):
        if S[i+1:].startswith(S[:i+1]):
            ret = 2*(i+1)

    return ret


if __name__ == "__main__":
    S = input()
    ans = ss(S)
    print(ans)

Submission status: Wrong Answer

Solution code:
def ss(S: str)->int:
    n = len(S)
    for i in range(n//2):
        if S[i+1:].startswith(S[:i+1]):
            return 2*(i+1)

    return 0


if __name__ == "__main__":
    S = input()
    ans = ss(S)
    print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
b=0
def sakana(sak):
  a=0
  for j in range((len(s)-sak-1)//2):
    if s[j] != s[(len(s)//2)+j]:
      break
    else:
      a=a+1
  if a==len(s)//2:
    return 0
  else:
    return 1

for i in range(len(s)):
  s.rstrip(s[-1])
  if (len(s)-i-1)%2==0 and sakana(i)==0:
    break
  else:
    b=b+1
print(len(s)-b-1)

Submission status: Wrong Answer

Solution code:
S = input()

def f(x):
  l = len(x)//2
  for i in range(l):
    if x[i] != x[l+i]:
      return False
  else:
    return True

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

Submission status: Wrong Answer

Solution code:
S = input()

def f(x):
  l = len(x)//2
  for i in range(l):
    if x[i] != x[l+i]:
      return False
  else:
    return True

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

Submission status: Wrong Answer

Solution code:
S = input()

for _ in range(0, len(S)//2, 2):
    S = S[:-2]
    N = len(S)
    if S[:N//2] == S[N//2:]:
        break

print(len(S))

Submission status: Wrong Answer

Solution code:
s=input()
def check(word):
    word_set=list(set([i for i in word]))
    for j in range(len(word_set)):
        if word.count(word_set[j])%2!=0:
            return False
    return True
for i in range(1,len(s)):
    string=s[0:len(s)-i]
    if check(string):
        print(len(string))
        break
else:
    print(1)

Submission status: Wrong Answer

Solution code:
s=input()
def check(word):
    word_set=list(set([i for i in word]))
    for j in range(len(word_set)):
        if word.count(word_set[j])%2==1:
            return False
    return True
for i in range(1,len(s)):
    string=s[0:len(s)-i]
    if check(string):
        print(len(string))
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

for n in range(len(s) // 2 - 1, -1, -1):
    if s[:n] == s[n: 2 * n]:
        ans = s[: 2 * n]
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
del s[-2:]
a = 2
while s[:len(s)//2] != s[len(s)//2:]:
    s = s[:-2]
    a += 2
print(a)

Submission status: Wrong Answer

Solution code:
S = input().rstrip()
for i in range(1, len(S)):
    a = S[:-i]
    l = len(a)
    if l % 2 == 0:
        if a[0:l//2] == a[l//2:]:
            print(a)
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1, n):
    if s[:n-i] == s[n-i:2*(n-i)]:
        print(2*(n-i))

Submission status: Wrong Answer

Solution code:
def func(s):
    a = s[:len(s) // 2]
    b = s[len(s) // 2:]
    if a == b:
        return True
    else:
        return False


def main():
    s = input()
    for i in range(1, len(s)):
        t = s[:-i]
        if func(t):
            print(len(t))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    def func(s):
        if len(s) % 2 == 1:
            return False

        a = s[:len(s) // 2]
        b = s[len(s) // 2:]
        if a == b:
            return True
        else:
            return False

    s = input()
    for i in range(1, len(s)):
        t = s[:-i]
        if func(t):
            print(len(t))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    def func(s):
        # if len(s) % 2 == 1:
        #     return False

        a = s[:len(s) // 2]
        b = s[len(s) // 2:]
        if a == b:
            return True
        else:
            return False

    s = input()
    for i in range(1, len(s)):
        t = s[:-i]
        if func(t):
            print(len(t))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ans = 0
s = input()
for i in range(1,len(s)):
    if s[:i] == "".join(list(reversed(s[:i]))):
        ans = i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def isEven(s):
  half = len(s) // 2
  if (s[:half] == s[half:]):
    return True
  else:
    return False
st = input()
ans = 0
for i in range(len(st) - 1):
  for j in range(i, len(st)):
    st2 = st[:i] + st[j:]
    if ((isEven(st2) == True) & (len(st2) < len(st)) & (len(st2) >= ans)):
      ans = len(st2)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
query = 'abcdefghijklmnopqrstuvwxyz'
ans =0
for j in range(len(s)):
 judge = s[0:j]
 for i in query:
  if judge.count(i)%2 == 0:
   if i == 'z':
    ans = max(ans,j)
  else:
   break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()


for i in range(len(s)):
    ans = s[:min(len(s), -(i+1))]
    if(len(ans)%2==1):
        continue
    else:
        mid = int(len(ans)/2)
        if(mid>0):
            if(ans[:mid]==ans[mid:]):
                print(mid*2)

Submission status: Wrong Answer

Solution code:
S = input()

i = 0
leng = len(S)

while 1:
    i += 1
    if S[:leng//2 - i] == S[leng//2 - i:leng - 1 - i]:
        print(leng//2 - i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#B ss
a = input()
l = len(a) -1
k=0
if l%2!=0 :
    l -=1

for i in range(l//2):
    l -=2
    if a[0:l//2] == a[l//2:l]:
        k = l
        break
        
print(k)

Submission status: Wrong Answer

Solution code:
#B ss
a = input()
l = len(a) -1
if l%2!=0 :
    l -=1

for i in range(l//2):
    l -=2*i
    if a[0:l//2] == a[l//2:l]:
        print(l)
        break

Submission status: Wrong Answer

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


def main():
    """Function."""
    s = str(input())

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

    print(max_len)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = list(input())

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

Submission status: Wrong Answer

Solution code:
S = input()


def is_ss(t):
    if len(t) % 2 or t[:len(t)//2] != t[len(t)//2:]:
        return False
    else:
        return True


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

Submission status: Wrong Answer

Solution code:
str_list = list(input())
del str_list[len(str_list)-1]
str_file = {}
str_list1 = str_list
for i in str_list:
    str_file[i] = 0
for i in str_list:
    str_file[i] += 1
for j in range(len(str_list)):
    for i in str_list:
        if i == str_list[len(str_list)-j-2]:
            if str_file[i] % 2 != 0:
                str_file[i] -= 1
sum_ = 0
nstr_list = list(str_file.items())
for i in range(len(nstr_list)):
    sum_ += nstr_list[i][1]
print(sum_)

Submission status: Wrong Answer

Solution code:
S = input()
l = S.__len__()
for i in range((l-1)//2,0,-1):
  if S[0:i-1] == S[i:i+i-1]:
    print(2*i)

Submission status: Wrong Answer

Solution code:
s = input()
n = (len(s) - 1) // 2

for i in reversed(range(1, n + 1)):
  if s[:i] == s[i:2*i]:
    print(i)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#-*-coding:utf8-*-

input_str = input()

flag = True
finalnum = len(input_str)

while flag:
    input_str = input_str[0:len(input_str)-1]
    str_array = {}
    for i in range(0, len(input_str)-1):
        if str(input_str[i:i+1]) in str_array:
            str_array[input_str[i:i+1]] += 1
        else:
            str_array[input_str[i:i+1]] = 1
    for i in str_array:
        if int(str_array[i] % 2) == 0:
            flag = False
        else:
            flag = True

    finalnum = len(input_str)

print(finalnum-1)

Submission status: Wrong Answer

Solution code:
s = input()
for i in range(len(s)):
    str = s[:-i]
    str_half_length = int(len(str) / 2)
    str_1 = str[str_half_length:]
    str_2 = str[:str_half_length]
    if str_1 == str_2 and i != 0:
        print(str_half_length * 2)

Submission status: Wrong Answer

Solution code:
s = input()
for i in range(len(s)):
    str = s[:-i]
    # print(str)
    str_half_length = int(len(str) / 2)
    # print(str_half_length)
    str_1 = str[str_half_length:]
    str_2 = str[:str_half_length]
    if str_1 == str_2 and i != 0:
        print(str_half_length * 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
listS = list(input())
syuL =[]
kazuL =[]

index=0
while index< len(listS):
    if listS[index] in syuL:
        i1=syuL.index(listS[index])
        kazuL[i1] += 1
    else:
        syuL.append(listS[index])
        kazuL.append(1)
    index+=1

listS.reverse()
index2 =0
while index2 < len(listS):
    flag=0
    i2 = syuL.index(listS[index2])
    kazuL[i2]-=1
    sum=0
    for kazu in kazuL:
        if kazu%2!=0:
            flag=1
            break
        else:
            sum+=kazu
    if flag!=1:
        print(sum)
        break
    else:
        index2+=1

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

from collections import Counter

s = lc()

ans = 0
cnt = Counter([])
for i, si in enumerate(s[:-1]):
    allEven = True
    cnt[si] += 1
    
    for cnti in cnt.values():
        if cnti%2 == 1:
            allEven = False
            
    if allEven:
        ans = i+1
        
print(ans)

Submission status: Wrong Answer

Solution code:
def judge(S):
    half = int(len(S)/2)
    if S[:half] == S[half:]:
        return True
    else:
        return False

S= input()
l = len(S)
if l%2 == 1:
    S = S[:-1]
else:
    S = S[:-2]
print(S)
while S != "":
    if judge(S):
        break
    S = S[:-2]

print(len(S))

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

from collections import Counter

s = lc()
cnt = Counter(s)

sr = s[::-1]

cntr = Counter([])
delete = 0
for sri in sr:
    alleven = True
    cntr[sri] += 1
    
    for cntrv in cntr.values():
        if cntrv % 2 == 1:
            alleven = False
            
    if alleven:
        delete = sum(cntr.values())
        break
    
    delete = len(s)
    
print(len(s) - delete)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def che(s):
    lens = len(s)
    if s[:lens//2] == s[lens//2:]:
        TF = True
    else:
        TF = False
    return TF

S = input()
TF = False
ind = 0

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

while True:
    TF = che(S2)
    if TF == False:
        S2 = S2[:-2]
    else:
        ans = len(S2)
        print(ans)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#66b
s = input()
n = len(s)  

if len(s)%2!=0:
    s=s[:-1]

for _ in range(n):
    if s[len(s)//2:]==s[:len(s)//2]:
        print(len(s))
        exit()
    else:
        s=s[:-2]

Submission status: Wrong Answer

Solution code:
#66b
s = input()
    
for _ in range(len(s)):
    if len(s)%2==0:
        if s[len(s)//2:]==s[:len(s)//2]:
            print(len(s)//2)
            exit()
        else:
            s=s[:-2]
    else:
        s=s[:-1]

Submission status: Wrong Answer

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

def main():
    s = input()[::-1]

    for i in range(1, len(s)):
        temp = s[i:]
        if len(temp) % 2 == 0:
            before = temp[:len(temp)//2]
            after = temp[len(temp)//2:]
            if before == after:
                print(len(temp))

if __name__ == '__main__':
    main()

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 = raw_input()
while len(s) % 2 or s[:len(s)/2] != s[len(s)/2:]:
	s = s[:-1]
print len(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# input
S = input()

for i in range(len(S) // 2 - 1):
    if S[:i] + S[:i] == S[:2 * i]:
        ans = i

print(2 * ans)

Submission status: Wrong Answer

Solution code:
# input
S = input()

for i in range(len(S)):
    if S[:i] + S[:i] == S[:2 * i]:
        ans = i

print(2 * ans)

Submission status: Wrong Answer

Solution code:
# input
S = input()

for i in range(len(S)):
    if S[:i] + S[:i] == S[:2 * i]:
        ans = i

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def f(a):
    for v in set(a):
        if a.count(v) % 2 == 1:
            return False
    return True

a = input()[:-1]
while a:
    if f(a):
        print(len(a))
        exit()
    else:
        a = a[:-1]
print(0)

Submission status: Wrong Answer

Solution code:
def f(a):
    for v in set(a):
        if a.count(v) % 2 == 1:
            return False
    return True

a = input()[:-1]
for i in range(len(a)):
    if f(a):
        print(len(a))
        exit()
    else:
        a = a[:-1]
print(0)

Submission status: Wrong Answer

Solution code:
def f(a):
    for v in set(a):
        if a.count(v) % 2 == 1:
            return False
    return True

a = input()[:-1]
for i in range(len(a)):
    if f(a):
        print(len(a))
        exit()
    else:
        a = a[:-1]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(len((lambda s: [s[:i] for i in reversed(range(len(s))) if s[:i]==s[i:]])(input())[0]))

Submission status: Wrong Answer

Solution code:
print((lambda s: [s[:i] for i in reversed(range(len(s))) if s[:i]==s[i:]])(input())[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
s_num = int(len(s)/2)
for i in range(s_num):
   s_re = s[0:2*i]
   if i!=0 and s_re[0:i] == s_re[i:2*i]:
      print(len(s_re))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# main関数
if __name__ == '__main__':

    S = input()
    ans = 0

    for s in range(0, len(S)) :
        for t in range(s, len(S)) :
            if ((s - t) % 2 == 1) and S[s: int((s+t) / 2)] == S[int((s + t) / 2) + 1: t] :
                if (t - s + 1 != len(S)) :
                    ans = max(t - s + 1, ans)
    print(ans)

Submission status: Wrong Answer

Solution code:
s = "".join(list(reversed(input())))
n = len(s)

ans = 0
for i in range(n):
    if (n - i) % 2 == 0:
        now = s[i:]
        if now[(n-i)//2:] == now[:(n-i)//2]:
            ans = n - i
            break
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
ret = 0
even = [True for _ in range(26)]
for i in range(0, len(S)-1):
    index = ord(S[i]) - ord('a')
    even[index] = not even[index]
    if sum(even) == 26:
        ret = i + 1

print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

if len(s) % 2 != 0:
    s = s[:len(s)-1]

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

Submission status: Wrong Answer

Solution code:
s = input()

if len(s) % 2 != 0:
    s = s[:len(s)-1]

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

Submission status: Wrong Answer

Solution code:
s = input()

if len(s) % 2 != 0:
    s = s[:len(s)-1]

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

Submission status: Wrong Answer

Solution code:
s = input()

while(True):
    s1, s2 = s[0:len(s)//2], s[len(s)//2:len(s)]
    if s1 == s2:
        print(len(s1)*2)
        break
 
    s = s[:-2]

Submission status: Wrong Answer

Solution code:
ss = input()
m = 0
for start in range(len(ss)//2):
    for end in range(1, len(ss)//2 + 1):
        if len(ss[start:end]) > 1 and ss[start:end] == ss[end:2*end - start]:
            if 2*end - start < len(ss):
                m = max(m, 2*len(ss[start:end]))
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
letters = input()
print(letters)
while True:
    not_equal = 0
    length = len(letters)
    letters = letters[:length-1]
    print(letters)
    if len(letters) % 2 != 0:
        continue

    if int(len(letters)) % 2 == 0:
        half = int(len(letters)/2 -1)
    else:
        half = int((len(letters)-1)/2)
    i = 0
    while i <= half:
        if letters[i] != letters[i + half + 1]:
            not_equal = 1
            break
        i += 1

    if not_equal == 0:
        print(len(letters))
        break

Submission status: Wrong Answer

Solution code:
import sys

s = input()
cnt = 0
cand_string = ''
cand_string_double = ''
for c in s:
    cand_string += c
    cand_string_double = cand_string * 2
    if cand_string_double == s[0:len(cand_string_double)]:
        print(len(cand_string_double))
        sys.exit()

Submission status: Wrong Answer

Solution code:
#!/usr/bin
# -*- coding="utf-8" -*-
 
s = input()
sn = len(s)

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin
# -*- coding="utf-8" -*-
 
s = input()
sn = len(s)

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

S = sys.stdin.readline()

S2 = ""
for i in range(1, len(S)):
	S2 = S[0:-i]
	if len(S2)%2 != 0:
		continue
	S3 = S2[0:int(len(S2)/2)]
	S4 = S2[int(len(S2)/2):]

	if S3 == S4:
		break

print(str(len(S2)))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

S = sys.stdin.readline()

for i in range(1, len(S)):
	S2 = S[0:-i]
	if len(S2)%2 != 0:
		continue
	S3 = S2[0:int(len(S2)/2)]
	S4 = S2[int(len(S2)/2):]

	if S3 == S4:
		print(str(len(S2)))
		break

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

S = sys.stdin.readline()

for i in range(1, len(S)):
	S2 = S[0:-i]
	if len(S2)%2 != 0:
		continue
	S3 = S2[0:int(len(S2)/2)]
	S4 = S2[int(len(S2)/2):]

	if S3 == S4:
		print(str(len(S2)))
		break

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    s = input()
    data = list(s)
    while len(data):
        data.pop()
        if len(data) % 2 == 0:
            half = int(len(data) / 2)
            if data[:half] == data[half:]:
                print(half)
                break

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    s = input()
    data = list(s)
    while len(data):
        data.pop()
        if len(data) % 2 == 0:
            half = int(len(data) / 2)
            if data[:half] == data[half:]:
                print("".join(data[:half]))
                break

Submission status: Wrong Answer

Solution code:
s = input()

s = s[:-1]
if len(s) % 2 != 0:
    s = s[:-1]


while(True):
    s1, s2 = s[0:len(s)//2], s[len(s)//2:len(s)]
    print(s1, s2)
    if s1 == s2:
        print(len(s1)*2)
        break

    s = s[:-2]

Submission status: Wrong Answer

Solution code:
s = input()

s = s[:-1]
if len(s) % 2 != 0:
    s = s[:-1]


while(True):
    s1, s2 = s[0:len(s)//2], s[len(s)//2:len(s)]
    print(s1, s2)
    if s1 == s2:
        print(len(s1))
        break

    s = s[:-2]

Submission status: Wrong Answer

Solution code:
string = input()
length = len(string)
for i in range(length):
    if length-(i+1)%2 != 0:
        continue
    else:
        if string[:(length-(i+1))/2] == string[(length-(i+1))/2:length-(i+1)]:
            print(length-(i+1))
            break

Submission status: Wrong Answer

Solution code:
S = list(input())
while(True):
    if(S == S[::-1]):
        print(int(len(S)))
        break
    del S[-1]

Submission status: Wrong Answer

Solution code:
s = raw_input()
j = 0
for i in xrange(len(s) - 1, 0, -1):
	mid = (i - j) / 2
	if s[j:mid] == s[mid:i]:
		print len(s[j:i])

Submission status: Wrong Answer

Solution code:
s = input()

for i in reversed(range(1, int((len(s)-1)/2+1))):
    if(s[:i] == s[i:2*i]):
        print(2*i)

Submission status: Wrong Answer

Solution code:
s = input()

for i in reversed(range(1, int((len(s))/2+1))):
    print(s[:i])
    print(s[i:2*i])
    if(s[:i] == s[i:2*i]):
        print(2*i)

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
def iseven(str, n):
    for i in range(0, n//2):
        if str[i] != str[i+n//2]:
            return False
    else:
        return True


for i in range(2, n, 2):
    if iseven(s, n-i):
        print(n-i)

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
def iseven(str, n):
    for i in range(0, n//2):
        if str[i] != str[i+n//2]:
            return False
    else:
        return True


for i in range(2, n, 2):
    if iseven(s, n-i):
        print(i)

Submission status: Wrong Answer

Solution code:
S = input()
maxi = -1000
for i in range(2,10,2):
    if (S[0:len(S)-i][0:(len(S)-i)//2]==S[0:len(S)-i][(len(S)-i)//2:len(S)-i]):
        if maxi<=(len(S)-i):
            maxi = len(S)-i
            print(maxi)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
S = input()

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

Submission status: Wrong Answer

Solution code:
#s = list(input())
s = input()
n = len(s)
count = 1   #消した数
 
if n % 2 == 1:
    count += 1
 
while s[0 : int((n-count)/2)] != s[int((n-count)/2) : n-count]:
    count += 2
 
if count == 0:
    count = int(n/2)
 
print(n-count)

Submission status: Wrong Answer

Solution code:
def f(x):
    return len(x) % 2 == 0 and x[:len(x)//2] == x[len(x)//2:]
 
x=input()
while not f(x):
    x=x[:-1]
 
print(len(x))

Submission status: Wrong Answer

Solution code:
st=input()
num=len(st)

for x in range(1,num+1):
    st=st.rstrip(st[-1:])
    num=len(st)
    if num%2==0:
        p=int(num/2)
        st1=st[:p]
        st2=st[-p:]
        if st1==st2:
            print(len(st))
            break
        else:
            continue
    else:
        continue

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    s = S()
    e = set()
    r = len(s)
    for c in s[::-1]:
        r -= 1
        if c in e:
            e.remove(c)
        else:
            e.add(c)
        if not e:
            return r

    return -1


print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import numpy as np

if __name__=="__main__":
    s = input().replace("\n", "")
    n = len(s)
    ss = ""
    if n%2 == 1:
        s = s[0:n-1]
        n = len(s)
    elif n%2 == 0:
        s = s[0:n-2]
        n = len(s)

    for i in list(range(2,n,2)):
        ss = s[0:n-i]
        m = len(ss)
        if ss[0:int(m/2)] == ss[int(m/2):m]:
            print(len(ss))
            break