Problem:


Score : 200 points

Problem Statement

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.

Constraints

1 \leq N \leq 100

S consists of lowercase English letters.

|S| = N

Input

Input is given from Standard Input in the following format:

N
S

Output

If S is a concatenation of two copies of some string, print Yes; otherwise, print No.

Sample Input 1

6
abcabc

Sample Output 1

Yes

Let T =  abc, and S = T + T.

Sample Input 2

6
abcadc

Sample Output 2

No

Sample Input 3

1
z

Sample Output 3

No



Sample input:
6
abcabc


Sample output:
Yes

Submission status: Accepted

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    N = int(input())
    S = input()
    logging.info("Hello!")

    if N % 2 == 1:
        print("No")
    else:
        half_S_1 = S[0:N // 2]
        logging.info(half_S_1)
        half_S_2 = S[N // 2:N]
        logging.info(half_S_2)

        if half_S_1 == half_S_2:
            print("Yes")
        else:
            print("No")
            
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = input()

    if N % 2 != 0 or len(S) % 2 != 0:
        print("No")
        exit()

    for i in range(N//2):
        if S[i] != S[i+N//2]:
            print("No")
            exit()

    print("Yes")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
st = s[0:int(n/2)]
nd = s[int(n/2):]
if st == nd:
    print('Yes')
else:print('No')

Submission status: Accepted

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

tmp = int(n / 2)

if s[0:tmp] == s[tmp:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if S[:int(N/2)] == S[int(N/2):]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

flg = True
if N%2 == 0:
    for i in range(N//2):
        if S[i] != S[i+N//2]:
            flg = False
            break
else:
    flg = False
    
if flg:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N=int(input())
S=list(input())

if S[:int(N/2)]==S[int(N/2):]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

if N % 2 == 0:
    S1 = S[:int(N/2)]
    S2 = S[int(N/2):]

    if S1 == S2:
        print("Yes")
    else:
        print("No")

else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n%2 == 1:
    print('No')
elif s[0:n//2] == s[n//2:]:
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
s=str(input())

if n%2==1:
	print("No")
	
else:
	s1=s[0:int(n/2)]
	s2=s[int(n/2):n]
	#print(s1)
	#print(s2)
	if s1==s2:
		print("Yes")
	else:
		print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())

center = int(N/2)

if S[:center] == S[center:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# get a integer
n = int(raw_input())
s = raw_input()


if n % 2 == 0:
  r=s[0:n/2] == s[n/2:]
else:
  r=False
if r:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
n = int(input())
s = input()
if n%2 == 1:
    print("No")
else:
    for i in range(n//2):
        if s[i] != s[i+n//2]:
            print("No")
            sys.exit()
    print("Yes")

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N % 2 != 0:
  print('No')
  exit()
x = N // 2
for i in range(x):
  if S[i] != S[i + x]:
    print('No')
    exit()
print('Yes')

Submission status: Accepted

Solution code:
N=int(input())
S=input()
n=1
if N%2!=0:
  print("No")
else:
  for i in range(N//2):
    if not S[i]==S[i+N//2]:
      n=0
  if n:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
sp = int(n/2)
s1 = s[:sp]
s2 = s[sp:len(s)]
print("Yes") if s1 == s2 else print("No")

Submission status: Accepted

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

if N%2==1:
    print("No")
    exit()

if S[:(N+1)//2]==S[N//2:]:
    result="Yes"
else:
    result="No"
print(result)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
S = str(input())

if(N % 2 == 0):
    if(S[: N//2] == S[N//2:]):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
s=input()
if n%2!=0:
  print('No')
elif s[0:n//2]==s[n//2:]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2 == 1:
    print('No')
else:
    t = int(n / 2)
    if s[:t] == s[t:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
n=int(input())
s=input()
flag=1
if n%2==1:
  print('No')
else:
  for i in range(n//2):
    if s[i]==s[i+n//2]:
      flag*=1
    else:
      flag*=0
  if flag==1:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

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

(d, m) = divmod(N, 2)

if m == 1:
  print("No")
else:
  for i in range(0, d):
    if S[i] != S[i+d]:
      print("No")
      break
  else:
    print("Yes")

Submission status: Accepted

Solution code:
n = int(input())
a = list(str(input()))

if a[0:int((n)/2)] == a[int((n)/2):n]:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

if n % 2 != 0:
    print("No")
    exit()

half = n // 2

for i in range(half):
    if s[i] != s[i+half]:
        print("No")
        exit()

print("Yes")

Submission status: Accepted

Solution code:
N = input()
S = input()
if len(S)%2 == 0 and S[:len(S)//2] == S[len(S)//2:]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def Echo():
    N = int(input())
    S = input()
    if S[:N // 2] == S[N // 2:]:
        print("Yes")
    else:
        print("No")


Echo()

Submission status: Accepted

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

f = 0

if n % 2 == 0:
    for i in range(0,n//2):
        if s[i] == s[i+n//2]:
            pass
        else:
            f = 1
            break
else:
    f = 1

if f:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

n = int(input().strip())
s = input().strip()

if n % 2 == 1:
    print('No')
elif s[:n//2] == s[n//2:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

if n%2 == 0:
  num = int(n/2)
  
  if s[:num] == s[num:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = list(map(str,input()))
ans = "Yes"
for i in range(n//2):
  if s[i] != s[i+n//2]:
    ans = "No"
    break
if n%2:
  ans = "No"
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
str = input()

if n%2 == 0:
    if str[:int(n/2)] == str[int(n/2):]:
        print("Yes")
    else:
        print("No")
        
else:
    print("No")

Submission status: Accepted

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


s1 = s[0:int(n/2)]
s2 = s[int(n/2):n]

if(s1 == s2):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

if N % 2 != 0:
    print('No')
else:
    # print((N / 2) - 1)
    left = S[0: int((N / 2))]
    right = S[int((N / 2)): N]

    # print("left:{0},right:{1}".format(left, right))
    if left == right:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

S1 = S[:int(N/2)]
S2 = S[int(N/2):]

if S1 == S2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n=int(input())
s=input()
if n%2==1:
  print("No")
else:
  for i in range(int(n/2)):
    if s[i]!=s[i+int(n/2)]:
      print("No")
      exit()
  print("Yes")

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())

u = N//2

T1 = S[:u]
T2 = S[u:]

if T1 == T2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
tmp = n/2

if n % 2 != 0:
    print('No')
else:
    if s[:int(tmp)] == s[int(tmp):]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
import math
N = int(input())
S = input()
if N%2 == 1:
  print("No")
else:
  if S == S[:N//2]+S[:N//2]:
      print("Yes")
  else:
      print("No")

Submission status: Accepted

Solution code:
length=int(input())
s=input()
lens=len(s)
if(s[0:int(lens/2)] == s[int(lens/2):int(lens)]):
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
S = list(S)

if N % 2 != 0:
    print('No')
else:
    S1 = S[:int(N/2)]
    S2 = S[int(N/2):]
    if S1 == S2:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

half = int(n) / 2
test = s[0:int(half)]

if test == s[int(half):]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if N % 2 == 0:
    num = int(N / 2)
    if S[0:num] == S[num:N]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
# B
N = int(input())
S = input()
flag = False
if N % 2 == 0:
    a = N//2
    if S[0:a] == S[a:]:
        flag = True

if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
flag = 0
for i in range(1,N):
    if S[:i] == S[i:]:
        flag += 1
if flag == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2 != 0:
    print("No")
else:
    if "".join(list(s[:int(n/2)])) == "".join(list(s[int(n/2):])):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

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

if (N%2==1):
    print('No')
else:
    s = S[0:(N//2)]
    if S.count(s)==2:
      print('Yes')
    else:
      print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
before = ""
after = ""
if N % 2 != 0:
  print("No")
else:
  for i in range(N//2):
  	before += S[i]
  for j in range(N//2, N):
    after += S[j]
  if before == after:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, S: str):
    if len(S)%2 == 1:
        print(NO)
    else:
        if S[:len(S)//2] == S[len(S)//2:]:
            print(YES)
        else:
            print(NO)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
S=input()
T=N//2

if N%2==1:
  print('No')
else:
  if S[0:T]==S[T:N]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
def A():
    print(int(input())**2)

def B():
    length = int(input())
    s = str(input())
    if length%2 != 0 or s[:length//2]!=s[length//2:]:
        print('No')
    else:
        print('Yes')
B()

Submission status: Accepted

Solution code:
import sys
n = int(input())
s = input()
a = ""
b = ""
if n % 2 != 0:
  print("No")
  sys.exit()
else:
  for i in range(n):
    if i <= n / 2 - 1:
      a += s[i]
    else:
      b += s[i]
if a == b:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

if (N % 2 != 0):
	print('No')
else:
	halfN = int(N / 2)
	left = S[:halfN]
	right = S[halfN:]
	if (left == right):
		print('Yes')
	else:
		print('No')

Submission status: Accepted

Solution code:
#Beginner COnetst 145 /2019/11/16
#Probrem A
DEBUG = 0

def calc(n,S):
    if n%2 == 1:return 'No'
    h = n//2
    pre = S[0:h]
    if DEBUG == 1:print(pre)
    lat = S[h:n]
    if DEBUG == 1:print(lat)
    if pre == lat: return 'Yes'
    else: return 'No'

n = int(input())
S = input()


print(calc(n,S))

Submission status: Accepted

Solution code:

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()
S = input()
if S[:N//2] == S[N//2:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    S=list(input())
    if N%2==0:
        for i in range(N//2):
            if S[i]!=S[N//2+i]:
                print('No')
                break
        else:
            print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
# print(s[:n // 2], s[n//2+1:n])
if n % 2 == 1 :
    print("No")
elif s[:n // 2] == s[n//2:n]:
    print("Yes" )
else:
    print("No")

Submission status: Accepted

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

a = int(n / 2)

if n % 2 != 0:
    print('No')
else:
    if s[:a] == s[a:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
#191116 B
if __name__ == "__main__":
    N = int(input())
    S = input()
    if N % 2 == 1:
        print("No")
    else:
        if S[0:int(N/2)] == S[int(N/2):(N+1)]:
            print("Yes")
        else:
            print("No")

Submission status: Accepted

Solution code:
n = int(input())
s= input()
l = n//2
if n%2==1:
    print('No')
else:
    print('Yes' if s[:l]==s[l:] else 'No')

Submission status: Accepted

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

count=0
if(N%2==1):
    print("No")
else:
    flag=int(N/2)
    for i in range(0,flag):
        if(S[i]!=S[i+flag]):
            break
        else:
            count=count+1

    if(count==flag):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

if((n/2) % 1 == 0 and s[:(n//2)] == s[n//2:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if S[:int(len(S) / 2)] == S[int(len(S) / 2 ):] :
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N=int(input())
S=list(str(input()))
N_prime=int(N/2)
if N%2==1:
    print('No')
else:
    if S[0:N_prime]*2==S:
            print('Yes')
    else:print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
if(s == s[0:n//2] + s[0:n//2]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if N % 2:
    print('No')
    exit()

if S[0:N//2] == S[N//2:N]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
r=int(input())
s=input()

sa=("".join(s[0:r//2]))
sb=("".join(s[r//2:r]))
if sa==sb:
  print("Yes")
elif r%2==1:
  print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
n = int(input())
s = input()

if n % 2 == 1:
    print("No")
    sys.exit()

a = int(n/2)
if s[:a] == s[a:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if n % 2 != 0 or s[:n//2] != s[n//2:]:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
Answer = 'No'
if N%2 == 0:
  if S[:int(N/2)]==S[int(N/2):]:
    Answer = 'Yes'
print(Answer)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N % 2:
    print('No')
else:
    d = N // 2
    if S[:d] == S[d:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

ans = 'Yes'
if n%2 == 1:
  ans = 'No'
else:
  for i in range(n // 2):
    if s[i] != s[i + n//2]:
      ans = 'No'
      break

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if S[:(N//2)] == S[(N//2):]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
ll = int(input())
s = input().strip()
if ll % 2 == 0:
    half = ll // 2
    # print(s[:half])
    # print(s[half:])
    if s[:half] == s[half:]:
        print('Yes')
        exit(0)
    
print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
if N%2 != 0:
  print('No')
else:
  if S[:(N//2)] == S[(N//2):]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ans = s[0:int(len(s)/2)]
if 2*ans == s:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())//2
S = input()
ans = "Yes "if S[:N] == S[N:] else "No"
print(ans)

Submission status: Accepted

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

import sys
import math

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    n = int(lines[0])
    s = lines[1]

    return (n, s)


def solve(n, s):

    result = 'No'
    if n % 2 != 0:
        return result
    
    m = n // 2

    a = s[:m]
    b = s[m:]
    
    if a == b:
        result = 'Yes'
        

    return  result


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2 == 0:
  if s[:n//2] == s[n//2:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
  exit()
for i in range(n//2):
  if s[i] != s[i+n//2]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
S = input()  
len = len(S)
l2 = len // 2 
T1 = S[0:l2]
T2 = S[l2:len]
if T1 == T2: 
    print("Yes")
else: 
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
i = int(n / 2)
l = s[:i]
r = s[i:]

if l == r:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n % 2 == 1 or s[:n//2] != s[n//2:]:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys
N = int(input())
S = input()
if S[len(S)//2:] ==S[:len(S)//2]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
han_1 = ''
han_2 = ''
if N % 2 != 0:
    print('No')
else:
    n = int(N/2)
    #print(n)
    for i in range(n):
        han_1 = han_1 + S[i]
    for i in range(n,N):
        han_2 = han_2 + S[i]

    if han_1 == han_2:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
N = int(input())
s = input()

if(N%2!=0):
    print('No')
else:
    a = s[:N//2]
    b = s[N//2:]
    if(a==b):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

ans = "No"


if n % 2 == 0:
	if s[0:int(n/2)] == s[int(n/2):n]:
		ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
import sys
N = int(input())
S = input()
s1 = S[:N//2]
s2 = S[N//2:]
if N%2 == 1:
    print("No")
    sys.exit()
for i in range(N//2):
    if not s1[i] == s2[i]:
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
n=int(input())
s=input()
if n%2==0 and s[:n//2] == s[n//2:]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
src = ""
for i in range(0, int(n/2)):
    src += s[i]
if src + src == s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())

if len(s) % 2 != 0:
    ans = 'No'
else:
    h = len(s) // 2
    t1 = s[:h]
    t2 = s[h:]
    if t1 == t2:
        ans = 'Yes'
    else:
        ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
a = input()

a = int(a)

b = input()

if a%2 == 1:
    print('No')
    exit(0)

if (b[0:(a//2)] == b[(a//2):]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input().strip())
S = input().strip()

result = 'No'
if N % 2 == 0 and S[0:int(N/2)] == S[int(N/2):]:
    result = 'Yes'
print(result)

Submission status: Accepted

Solution code:
import math

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

mid = math.ceil(N/2)
if S[:mid] == S[mid:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

n = int(n)

if (n % 2) != 0:
  print("No")
else:
  s1 = s[:int(n/2)]
  s2 = s[int(n/2):]
  
  if s1 == s2:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
def get_input():

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

    return N, S


def main():

    N, S = get_input()

    if N % 2 == 1:
        print('No')
        return

    if S[int(N / 2):] == S[:int(N/2)]:
        print('Yes')
        return

    print('No')


main()

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
if n % 2 == 1:
  print('No')
else:
  numT = n // 2
  if s[0:numT] == s[numT:n]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())
ans = 'Yes'
if(n % 2 == 0):
    N = int(n / 2)
    for i in range(N):
        if(s[i] != s[i + N]):
            ans = 'No'
else:
    ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if n%2!=0:
  print('No')
else:
  flag = 0
  for i in range(n//2):
    if s[i] != s[n//2+i]:
      flag = 1
      break
  if flag == 1:
    print('No')
  else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys

def solve(n, s):
    if n % 2 == 1:
        print("No")
        return

    # print(s[0:n//2])
    # print(s[n//2:])
    if s[0:n//2] == s[n//2:]:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    n = int(sys.stdin.readline().strip())
    s = sys.stdin.readline().strip()
    solve(n, s)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
if n%2==1:
  print("No")
else:
  for i in range(n//2):
    if s[i]!=s[n//2+i]:
      print("No")
      break
    elif i==n//2-1:
      print("Yes")

Submission status: Accepted

Solution code:
# B - Echo
N =int(input())
S = str(input())
S_1 = S[:int(N/2)]
S_2 = S[int(N/2):]

if N % 2 != 0:
    print("No")
elif S_1== S_2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

s_list = list(s)

ans = 'Yes'

if n % 2 == 1:
    ans = 'No'
else:
    char_first_t = 0
    char_second_t = (n//2)
    for i in range(n//2):
        f = s_list[char_first_t]
        sec = s_list[char_second_t]
        if f != sec:
            ans = 'No'
        char_first_t += 1
        char_second_t += 1
        
print(ans)

Submission status: Accepted

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

s1 = s[:int(length/2)]
s2 = s[int(length/2):]

# print(s1, s2)

if s1 == s2: print("Yes")
else: print("No")

Submission status: Accepted

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

n=int(input())  #数値入力 「N」だけの入力のとき
s=str(input())  #数値入力 「N」だけの入力のとき
center = n//2
if n%2==1:
    print("No")
    exit()
first = s[:center]
second = s[center:]
if first == second:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if N%2==1:
    print("No")
else:
    tmp=S[0:N//2]
    if S==tmp+tmp:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = list(str(input()))
if n%2==1:
    print("No")
else:
    tmp=0
    for i in range(int(n/2)):
        if s[i] != s[i+int(n/2)]:
            tmp=1
            break
    if tmp==0:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
f=0
if n%2!=0:
    print('No')
    exit()
  
for i in range(int(n/2)):
    if s[i] != s[i+int(n/2)]:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
#import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
ts=time.time()
sys.setrecursionlimit(10**6)
#input=sys.stdin.readline().rstrip
show_flg=False
show_flg=True

ans=0
n=I()
s=input()
k=1
t=s[:n//2]
u=s[n//2:]
if n%2==1:
    k=1
elif t==u:
    k=0


print(YN[k])

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(10**8)
#input = sys.stdin.readline
def solve():
  n = int(input())
  s = input()
  if n%2 == 1:
    print("No")
    exit()
  ts = s[0:n//2]
  t2s = s[n//2::]
  if ts == t2s:
    print("Yes")
  else:
    print("No")
solve()

Submission status: Accepted

Solution code:

class Solution:
    def solve(self, n: int, s: str) -> str:

        s1 = s[:n//2]
        s2 = s[n//2:]

        if s1 == s2:
            return "Yes"
        else:
            return "No"


if __name__ == '__main__':

    # standard input
    n = int(input())
    s = input()

    # solve
    solution = Solution()
    print(solution.solve(n, s))

Submission status: Accepted

Solution code:
N=int(input())
S=input()
n=int(len(S))
l=int(n/2)
a=""
b=""
if n%2==0:
    for i in range(l):
        a+=S[i]
    for i in range(l,n):
        b+=S[i]
    if a==b:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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

if n%2 == 1:
  print('No')
elif s[:n//2] == s[n//2:]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
print('Yes'if s[0:(n//2)]==s[(n//2):] else 'No')

Submission status: Accepted

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

if len(S)%2 != 0:
    print('No')
else:
        if all(S[i] == S[i+N//2] for i in range(len(S)//2)):
            print('Yes')
        else:
            print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
a = ""
b = ""
if len(S)%2 == 1:
    print("No")
else:
    for i in range(0,(len(S)//2)):
        a += S[i]
    for j in range((len(S)//2),len(S)):
        b += S[j]
    if a == b:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys

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

if N % 2 != 0:
    print("No")
    sys.exit()

for i in range(N//2):
    if S[i] != S[i + (N // 2)]:
        print("No")
        sys.exit()

print("Yes")

Submission status: Accepted

Solution code:
# coding: utf-8
# ABC145B

n = int(input())
s = input()

if s[:n//2] == s[n//2:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

flag = "No" 

for i in range(length):
	if (s[:i] == s[i:]):
		flag = "Yes"
		break

print(flag)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
e = []
d = []
if n % 2 == 1:
  print("No")
else:
  for i in range(n // 2):
    e += [s[i]]
    d += [s[(n//2)+i]]
  if e == d:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
A = int(input())
B = str(input())
if (A==len(B)):
    if (B[:int(A/2)]==B[int(A/2):]):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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

if N % 2 != 0:
    print("No")
    exit()
print("Yes" if S[:N//2] == S[N//2:] else "No")

Submission status: Accepted

Solution code:
import sys

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

if N % 2 == 1:
  print("No")
  sys.exit()

x = N//2

if S[:x] == S[x:]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

if n%2!=0:
  print("No")

elif s[0:int(n/2)] == s[int(n/2):n]:
  print("Yes")

else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if s[0:int(n/2)] == s[int(n/2):n]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if (n % 2 == 0):
    x = n // 2
    if s[:x] == s[x:]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
if n%2==0:
  a = s[:n//2]
  b = s[n//2:]
  for i in range(n//2):
    if a[i]==b[i]:
      pass
    else:
      print("No")
      break
  else:
    print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
if N % 2 == 1:
  print("No")
  exit()
half = int(N/2)
for i in range(half):
  if S[i] != S[i+half]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

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

if N % 2 != 0:
  print('No')
else:
  tn = N // 2
#  print(S[:tn])
#  print(S[tn:])
  if S[:tn] == S[tn:]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())

m = int(N / 2)
if S[:m] == S[m:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
num = 0

if n%2 == 1:
  print("No")
  exit(0)

for i in range(int(n/2)):
  if s[i] == s[i+int(n/2)]:
    num += 1
    
if num == int(n/2):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

S1 = []
S2 = []

for i in range(int(N/2)):
    S1.append(S[i])
    S2.append(S[i+int(N/2)])
    
if S1 == S2:
    if N%2 == 1:
        print('No')
    else:
        print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())

head = s[:int(n/2)]
tail = s[int(n/2):]

if n == 1:
    print('No')
elif head == tail:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
p=input()
if(n%2!=0):
    print("No")
else:
    a=p[:n//2]
    b=p[n//2:]
    if(a==b):
        print("Yes")
    else:
        print("No")