Problem: Given are a positive integer N and a string S of length N consisting of lowercase English letters.  Determine whether the string is a concatenation of two copies of some string. That is, determine whether there is a string T such that S = T + T.

Submission attempts (in order):
def judge1(Num,a):
    if Num%2 == 0:
        j = int(Num/2 - 1)
        b = []
        for i in range(j+1):
            b.append(a[i])
        c = b + b
        alpha = "".join(c)
        if alpha == a:
            print("yes")
        else:
            print("No")
    else:
        print("No")

N = int(input())
S = str(input())

judge1(N,S)

def judge1(Num,a):
    s = []
    for l in range(2,Num):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(N,S)
if 1 == a[0]:
    print("yes")
else:
    print("No")

def judge(N,str):
    a = list(str)
    b = []
    c = []
    if N%2 == 0:
        for k in range(int(N/2)):
            b.append(a[k])
            c.append(a[k+int(N/2)])
        if b == c:
            print("yes")
        else:
            print("No")
    else:
        print("No")
N = int(input())
S = input()
judge(N,S)

def judge1(Num,a):
    if Num%2 == 0:
        j = int(Num/2 - 1)
        b = []
        for i in range(j+1):
            b.append(a[i])
        c = b + b
        alpha = "".join(c)
        if alpha == a:
            print("yes")
        else:
            print("No")
    else:
        print("No")

N = int(input())
S = input()

judge1(N,S)

def judge1(Num,a):
    s = []
    for l in range(2,Num):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(N,S)
if 1 in a:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    s = []
    for l in range(2,Num+1):
        if Num%l == 0 & l != Num:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(N,S)
if 1 in a:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    s = []
    for l in range(2,Num+1):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(N,S)
if 1 in a:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    s = []
    for l in range(2,Num):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(N,S)
if 1 in a:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    s = []
    for l in range(2,Num+1):
        if Num%l == 0 and l != Num:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(N,S)
if 1 in a:
    print("yes")
else:
    print("No")

def judge(N,str):
    a = list(str)
    b = []
    c = []
    if N%2 == 0:
        for k in range(int(N/2)):
            b.append(a[k])
            c.append(a[k+int(N/2)])
        if a == b + c:
            print("yes")
        else:
            print("No")
    else:
        print("No")
N = int(input())
S = input()
judge(N,S)


def judge1(Num,a):
    s = []
    for l in range(2,Num):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(N,A)
if 1 in a:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    s = []
    for l in range(1,Num):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c += b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(N,S)
if 1 in a:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    if Num%2 == 0:
        j = int(Num/2 - 1)
        b = []
        for i in range(j+1):
            b.append(a[i])
        c = b + b
        alpha = "".join(c)
        if alpha == a:
            print("yes")
        else:
            print("No")
    else:
        print("No")

N = int(input())
S = input()

judge1(N,"S")

def judge1(Num,a):
    s = []
    for l in range(1,Num,1):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            for i in range(j+1):
                b.append(alpha[i])
            c = b + b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(6,"abcabc")
if 1 in a:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    s = []
    for l in range(1,Num):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c += b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(9,"abcabcabc")
if 1 in a:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    s = list(range(Num))
    for l in range(2,Num):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s[l] = 1
            else:
                s[l] = 0
        else:
            s[l] = 0
    return s

N = int(input())
S = input()
a = judge1(N,S)
if 1 == a[2]:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    s = []
    for l in range(2,Num):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(N,S)
if 1 in a:
    print("yes",a)
else:
    print("No")

def judge1(Num,a):
    s = []
    for l in range(2,Num):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s.append(1)
            else:
                s.append(0)
        else:
            s.append(0)
    return s

N = int(input())
S = input()
a = judge1(N,S)
if 1 == a[0]:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    s = []
    for l in range(1,Num,1):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            for i in range(j+1):
                b.append(alpha[i])
            c = b + b
            if alpha == c:
                s.append("yes")
            else:
                s.append("No")
        else:
            s.append("No")
        return s

N = int(input())
S = input()

if judge1(6,"abcabc") in ["yes"]:
    print("yes")

def judge1(Num,a):
    s = list(range(Num+1))
    for l in range(2,Num+1):
        if Num%l == 0:
            alpha = list(a)
            j = int(Num/l - 1)
            b = []
            c = []
            for i in range(j+1):
                b.append(alpha[i])
            for k in range(l):
                c = c + b
            if alpha == c:
                s[l] = 1
            else:
                s[l] = 0
        else:
            s[l] = 0
    return s


N = int(input())
S = input()
a = judge1(N,S)
if 1 == a[2]:
    print("yes")
else:
    print("No")

def judge1(Num,a):
    if Num%2 == 0:
        alpha = list(a)
        j = int(Num/2 - 1)
        b = []
        for i in range(j+1):
            b.append(alpha[i])
        c = b + b
        if alpha == c:
            print("yes")
        else:
            print("No")
    else:
        print("No")

N = int(input())
S = input()

judge1(N,S)


N = int(input())
S = input()
a = list(str)
b = []
c = []
if N%2 == 0:
  for k in range(int(N/2)
        b.append(a[k])
        c.append(a[k+int(N/2)])
        if b == c:
            print("yes")
        else:
            print("No")
    else:
        print("No")

def judge(N,str):
    a = list(str)
    b = []
    c = []
    if N%2 == 0:
        for k in range(int(N/2)):
            b.append(a[k])
            c.append(a[k+int(N/2)])
        if b == c:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
N = int(input())
S = input()
judge(N,S)


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Accepted