Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02954 (python)

Fixed submission:
'''1. LR で region を区切る
2. 区切った中で、(Rの数+1)/2+(Lの数)/2 が十分時間が経った偶数回後にRの上にいる数、
   (Rの数)/2+(Lの数+1)/2 がLの上にいる数。'''
import re

S = input()

LRpos = [s.start() for s in re.finditer('LR', S)]
LRpos.insert(0, -1)
LRpos.append(len(S))

final_state = [0]*len(S)

for i in range(len(LRpos)-1):
    part_str = S[LRpos[i]+1:LRpos[i+1]+1]
    RLpos = part_str.find('RL')
    num_R = RLpos+1
    num_L = len(part_str) - num_R

    final_state[LRpos[i]+RLpos+1] = (num_R+1)//2 + num_L//2
    final_state[LRpos[i]+RLpos+2] = (num_R)//2 + (num_L+1)//2

print(' '.join(str(i) for i in final_state))

Buggy submission (verdict: Runtime Error):

S = input()

LRpos = [s.start() for s in re.finditer('LR', S)]
LRpos.insert(0, -1)
LRpos.append(len(S))

final_state = [0]*len(S)

for i in range(len(LRpos)-1):
    part_str = S[LRpos[i]+1:LRpos[i+1]+1]
    RLpos = part_str.find('RL')
    num_R = RLpos+1
    num_L = len(part_str) - num_R

    final_state[LRpos[i]+RLpos+1] = (num_R+1)//2 + num_L//2
    final_state[LRpos[i]+RLpos+2] = (num_R)//2 + (num_L+1)//2

print(final_state)
Problem p03221 (python)

Fixed submission:
import numpy as np
N, M = [int(a) for a in input().split()]
P = []
Y = []

for _ in range(M):
    p, y =  [int(a) for a in input().split()]
    P.append(p)
    Y.append(y)

index = {}
id = ["" for _ in range(len(P))]

for i in np.argsort(Y):
    index[P[i]] = index.get(P[i], 1)
    id[i] = "{0:06d}".format(P[i])+"{0:06d}".format(index[P[i]])
    index[P[i]] += 1

for i in id:
    print(i)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M = [int(a) for a in input().split()]
P = []
Y = []

for _ in range(M):
    p, y =  [int(a) for a in input().split()]
    P.append(p)
    Y.append(y)

index = [1 for _ in range(len(P))]
id = ["" for _ in range(len(P))]

for i in np.argsort(Y):
    id[i] = "{0:06d}".format(P[i])+"{0:06d}".format(index[P[i]])
    index[P[i]] += 1

for i in id:
    print(i)
Problem p03242 (python)

Fixed submission:
n = input()

ans = ""
for nn in n:
    if nn == "1":
        ans += "9"
    elif nn == "9":
        ans += "1"

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(aa) for aa in input().split()]

def add_entry(hist, aa):
    if aa in hist:
        hist[aa] += 1
    else:
        hist[aa] = 1


def make_hist(a):
    even_hist = {}
    odd_hist = {}

    for i in range(len(a)//2):
        add_entry(even_hist, a[2*i])
        add_entry(odd_hist, a[2*i+1])

    return even_hist, odd_hist


def get_sorted_hist(hist):
    return sorted(hist.items(), key=lambda x: -x[1])

eh, oh = make_hist(a)
seh = get_sorted_hist(eh)
soh = get_sorted_hist(oh)

print(seh, soh)

if seh[0][0] != soh[0][0]:
    print(len(a) - seh[0][1] - soh[0][1])
else:
    if len(seh) == 1 and len(soh) == 1:
        print(len(a)//2)
    elif len(seh) == 1:
        print(len(a) - seh[0][1] - soh[1][1])
    elif len(soh) == 1:
        print(len(a) - soh[0][1] - seh[1][1])
    else:
        print(min(len(a) - seh[0][1] - soh[1][1], len(a) - soh[0][1] - seh[1][1]))
Problem p03272 (python)

Fixed submission:
line = input().split()
N = int(line[0])
i = int(line[1])

print(N-i+1)

Buggy submission (verdict: Runtime Error):
line = input().split()
N = int(line[0])
i = int(line[1])

print(n-i+1)
Problem p02836 (python)

Fixed submission:
from sys import stdin
input = list(stdin.readline().rstrip())

n = len(input)

if n % 2 == 1:
    del input[n//2]
    n = len(input)
cnt = 0
for i in range(int(n/2)-1, -1, -1):
    if input[i] != input[n-i-1]:
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
from sys import stdin
input = list(stdin.readline().rstrip())

n = len(input)

if n % 2 == 1:
    del input[n//2]
    n = len(input)
cnt = 0
for i in range(n/2-1, -1, -1):
    print(i, n-i-1)
    if input[i] != input[n-i-1]:
        cnt += 1

print(cnt)
Problem p03011 (python)

Fixed submission:
inp = list(map(int, input().split(' ')))

l = []
for fst in inp:
    inp.remove(fst)
    for sec in inp:
        l.append(fst + sec)

print(min(l))

Buggy submission (verdict: Runtime Error):
inp = map(int, input().split(' '))

l = []
for fst in inp:
    for sec in inp:
        if fst == sec:
            pass
        else:
            l.append(fst + sec)

print(min(l))
Problem p03250 (python)

Fixed submission:
def main():
    inputs = sorted(input().split())
    fst = inputs[-1]
    lst = inputs[0]
    mid = inputs[1]

    print(eval('{}{} + {}'.format(fst, mid, lst)))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    inputs = sorted([int(x) for x in input().split()])
    fst = inputs[-1]
    lst = inputs[0]
    mid = inputs[1]

    print(eval(f'{fst}{mid} + {lst}'))


if __name__ == "__main__":
    main()
Problem p02879 (python)

Fixed submission:
n,m = list(map(int,input().split()))
if 0 < n < 10 and 0 < m < 10 :
  print(n*m)
else :
  print(-1)

Buggy submission (verdict: Runtime Error):
n,m = list(map(int,input().split))
if 0 < n < 10 and 0 < m < 10 :
  print(n*m)
else :
  print(-1)
Problem p03072 (python)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]
b = a[0]
c = 0
ans = 0
for i in range(N-1):
  c += 1
  if b <= a[c] :
    b = a[c]
    ans += 1
print(ans + 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(i) for i in input().split()]
b = a[0]
c = 0
ans = 0
for i in range(N):
  c += 1
  if b < a[c] and a[c - 1]  <a[c] :
    ans += 1
print(ans + 1)
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()

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

    if sa == sb:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
if N % 2 != 0:
    print("No")
else:
    sa = S[:(N//2)]
    sb = S[(N//2):]

    if sa == sb:
        print("Yes")
    else:
        print("No")
Problem p02879 (python)

Fixed submission:
A, B = input().split(" ")
A = int(A)
B = int(B)

if (0 < A) & (A < 10):
    if (0 < B) & (B < 10):
        print(A * B)
    else:
        print(-1)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())

def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
 
if len(divisor(N)) < 3:
    print(N - 1)
else:
    divisor_list = divisor(N)
    tmp = N
    for i in divisor_list:
        A = i
        B = N / i
        if tmp > (A + B - 2):
            tmp = (A + B - 2)
    print(int(tmp))
Problem p03104 (python)

Fixed submission:
from functools import reduce
from operator import xor

A, B = map(int,input().split())


def calc(A):
    A = A+1
    cnt = 0
    ans = 0
    for i in range(0,50):
        # i=0 2回周期で1が出現
        # i=1 4回周期で1が出現
        loop = pow(2,i+1)

        #端数を覗いた2の出現回数
        #Aが6 / iが1のときは loop=4
        # 7//4 = 1 * 2^1 = 2
        cnt = (A//loop)*pow(2,i)

        # 端数を計算
        # 7%4 - 4/2 = 3-2 = 1
        # 端数は1なので加算
        if((A%loop - loop//2) > 0):
            cnt = cnt + (A%loop - loop//2)

        # cntが奇数の場合は ans 2^iをに加算
        if(cnt%2 == 1):
            ans = ans + pow(2,i)

    return ans



def main():
    return calc(A-1)^calc(B)

print(main())

Buggy submission (verdict: Runtime Error):
from functools import reduce
from operator import xor

A, B = map(int,input().split())

def main():
    val = []
    for i in range(A,B+1):
        val.append(i)
        print(val)
    ans = reduce(xor,val)
    return ans

print(main())
Problem p02836 (python)

Fixed submission:
import sys

s = sys.stdin.read().strip()
c = 0
l = len(s)
for i in range(int(l/2)):
  if s[i] != s[l-i-1]:
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
    import sys
     
    s = sys.stdin.read().strip()
    c = 0
    l = len(s)
    for i in range(int(l/2)):
      if s[i] != s[l-i-1]:
        c += 1
    print(c)

Buggy submission (verdict: Runtime Error):
import sys

s = sys.stdin()
c = 0
l = len(s)
for i in range(l/2):
  if s[0] != s[l-i]:
    c += 1
print(c)
Problem p02954 (python)

Fixed submission:
#coding: utf-8
s = str(input())
child = [0] * len(s)
# for j in range(len(s)):
# 	child[j] = 1
r = 0
l = 0
# lIdx = 0
rIdx = 0

for i in range(len(s)):
	# print(str(r)+","+str(l))
	if s[i] == 'R':
		# print(i)
		r = r+1
		if s[i+1] == 'L':
			rIdx = i
	elif s[i] == 'L':
		l = l+1
		if i == len(s)-1 or s[i+1] == 'R':
			#1セットが終了する
			# print('r='+str(r)+" l="+str(l))
			if ((r+l)%2) == 0:
				child[rIdx] = (r+l)//2
				child[rIdx+1] = (r+l)//2
			else:
				if r%2==0:
					child[rIdx+1] = (r+l)//2 + 1
					child[rIdx] = (r+l)//2
				else:
					child[rIdx+1] = (r+l)//2
					child[rIdx] = (r+l)//2 + 1
			r = 0
			l = 0
			# lIdx = i-1
# child[rIdx-1] = l

#roop終わらない解法
# for j in range(10 ** 100):
# 	after = [0] * len(s)
# 	for i in range(len(s)):
# 		# print(i)
# 		if child[i] != 0:
# 			if s[i] == 'R':
# 				after[i+1] = after[i+1] + child[i]
# 				# child[i] = 0
# 			elif s[i] == 'L':
# 				after[i-1] = after[i-1] + child[i]
# 				# child[i] = 0
# 	child = after

print(" ".join(map(str,child)))

Buggy submission (verdict: Runtime Error):
#coding: utf-8
s = str(input())
child = [1] * len(s)
# for j in range(len(s)):
# 	child[j] = 1

for j in range(2):
	after = [0] * len(s)
	for i in range(len(s)):
		# print(i)
		if child[i] != 0:
			if s[i] == 'R':
				after[i+1] = after[i+1] + child[i]
				# child[i] = 0
			elif s[i] == 'L':
				after[i-1] = after[i-1] + child[i]
				# child[i] = 0
	child = after
	checkFlg = 0
	for k in range(len(child):
		if child[k] != -1:
			checkFlg = 1
	if checkFlg == 0


print(child)
Problem p03072 (python)

Fixed submission:
mount_count = input()
mount_heights = input()
mount_heights_list = mount_heights.split()
count = 0
max_height = int(mount_heights_list[0])
for mount_height in mount_heights_list:
    if max_height <= int(mount_height):
        max_height = int(mount_height)
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
mount_count = input()
mount_heights = input()
mount_heights_list = mount_heights.split()
count = 0
max_height = int(mount_heights_list[0])
for mount_height in mount_heights_list:
    if max_height <= int(mount_height):
        max_height = mount_height
        count += 1
print(count)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()

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

Buggy submission (verdict: Runtime Error):
s = input()

if n % 2 == 0:
    N = int(n / 2)
    a = s[:N]
    b = s[N:]
    if a == b:
        print('Yes')
    else:
        print('No')
else:
    print('No')
Problem p02847 (python)

Fixed submission:
s = input()
mapping = {'SUN': 0, 'MON':1, 'TUE':2, 'WED':3, 'THU':4, 'FRI':5, 'SAT':6}
if s == 'SUN':
  print(7)
else:
  print(7-mapping[s])

Buggy submission (verdict: Runtime Error):
s = input()
mapping = {'SUN':, 'MON':1, 'TUE':2, 'WED':3, 'THU':4
           , 'FRI':5, 'SAT':6}
if s == 'SUN':
  print(7)
else:
  print(7-mapping[s])
Problem p02859 (python)

Fixed submission:
r = int(input())
print(r*r)

Buggy submission (verdict: Runtime Error):
r = int(inpnut())
print(r*r)
Problem p02879 (python)

Fixed submission:
a, b = map(int, input().split())
if a <10 and b<10:
  print(a*b)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input.split())
if a <10 and b<10:
  	return a*b
else:
  return -1
Problem p03013 (python)

Fixed submission:
N, M = map(int, input().split())
A = set(int(input()) for i in range(M))
x = [0] * (N+1)
x[0] = 1
 
for i in range(1, N+1): 
  if i in A: x[i] = 0
  else:
    x[i] = (x[i-1] + x[i-2])%(10**9+7)
    
print(x[N])

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
A = set(int(input()) for i in range(M))
x = [0] * (n+1)
x[0] = 1

for i in range(1, n+1): 
  if x[i] in A:
    x[i] = 0
  else:
    x[i] = (x[i-1] + x[i-2])%(10**9+7)
return x[n]
Problem p03631 (python)

Fixed submission:
N = list(map(int, input()))
x = 0
for i in range(len(N) // 2):
  if N[i] != N[-i-1]:
    print('No')
    x = 1
    break
if x == 0:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N = list(map(int, input()))
x = 0
for i in range(N // 2):
  if N[i] != N[-i]:
    print('No')
    x = 1
    break
if x == 0:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N = list(map(int, input()))
x = 0
for i in range(N // 2):
  if N[i] != N[-i]:
    print('No')
    x = 1
    break
if x == 0:
  prin('Yes')
Problem p02860 (python)

Fixed submission:
n = int(input())
s = [str(x) for x in input()]
if n % 2 == 1:
    print('No')
else:
    a = int(n/2)
    if s[0:a] == s[a:]:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [str(x) for x in input()]
if n % 2 == 1:
    print('No')
else:
    if s[:((n/2)+1)] == s[((n/2)+1)]:
        print('Yes')
    else:
        print('No')
Problem p02951 (python)

Fixed submission:

a, b, c = (int(x) for x in input().split())

if a == b:
    print(c)
elif a - b >= c:
    print(0)
else:
    print(c - (a - b))

Buggy submission (verdict: Runtime Error):
a, b, c = (int(x) for x in input().split())

if a - b >= c:
    print(0)
else:
    print(c - (a - b)
Problem p03834 (python)

Fixed submission:
a,b,c=map(str,input().split(","))
print(a,b,c)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print(max([a*b,c*d])
Problem p02897 (python)

Fixed submission:
n = float(input())
ans = 0
if n % 2 == 0:
    ans = (n / 2) / n
else:
    ans = ((n + 1) / 2) / n

print('{:.10f}'.format(ans))

Buggy submission (verdict: Runtime Error):
n = float(input())
ans = 0
if n % 2 == 0:
    ans = (n / 2) / n
else:
    ans = (n + 1) / 2) / n

print('{:.10f}'.format(ans))
Problem p02836 (python)

Fixed submission:
A = input()
Len = len(A)
L = (Len // 2) + (Len % 2)
count = 0
for i in range(L):
  if A[i] != A[-i-1]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
A = input()
Len = len(A)
L = (Len // 2) + (Len % 2)
count = 0
for i in range(4):
  if A[i] != A[-i-1]:
    count += 1
print(count)
Problem p02951 (python)

Fixed submission:
inputNum = list(map(int, input().split()))

A = inputNum[0]
B = inputNum[1]
C = inputNum[2]

if ((C - (A - B)) > 0):
    print(C - (A - B))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
S = input()

count = 1
answer = [0] * len(S)
# RLの切り替わるインデックスをマーク
n = 0
for i in range(len(S) - 1):
    if (S[i] == S[i + 1]):
        count += 1
    else:
        if (S[i + 1] == 'R'):
            # Lを割り振る
            answer[n] += count // 2
            answer[n + 1] += -(-count // 2)
            count = 1
        else:
            # Rを割り振る
            answer[i] += -(-count // 2)
            answer[i + 1] += count // 2
            count = 1
            n = i
    # 右端のLを割り振る
    if (i == len(S) - 2):
        answer[n] += count // 2
        answer[n + 1] += -(-count // 2)

for c in answer:
    print(f"{c} ", end='')
print()
Problem p02954 (python)

Fixed submission:
S = input()

count = 1
answer = [0] * len(S)
# RLの切り替わるインデックスをマーク
n = 0
for i in range(len(S) - 1):
    if (S[i] == S[i + 1]):
        count += 1
    else:
        if (S[i + 1] == 'R'):
            # Lを割り振る
            answer[n] += count // 2
            answer[n + 1] += -(-count // 2)
            count = 1
        else:
            # Rを割り振る
            answer[i] += -(-count // 2)
            answer[i + 1] += count // 2
            count = 1
            n = i
    # 右端のLを割り振る
    if (i == len(S) - 2):
        answer[n] += count // 2
        answer[n + 1] += -(-count // 2)

for i, c in enumerate(answer):
    print(c, end='')
    print(' ', end='')

Buggy submission (verdict: Runtime Error):
S = input()

count = 1
answer = [0] * len(S)
# RLの切り替わるインデックスをマーク
n = 0
for i in range(len(S) - 1):
    if (S[i] == S[i + 1]):
        count += 1
    else:
        if (S[i + 1] == 'R'):
            # Lを割り振る
            answer[n] += count // 2
            answer[n + 1] += -(-count // 2)
            count = 1
        else:
            # Rを割り振る
            answer[i] += -(-count // 2)
            answer[i + 1] += count // 2
            count = 1
            n = i
    # 右端のLを割り振る
    if (i == len(S) - 2):
        answer[n] += count // 2
        answer[n + 1] += -(-count // 2)

for i, c in enumerate(answer):
    if (i == 0):
        print(c, end='')
    else:
        print(f" {c}", end='')

Buggy submission (verdict: Runtime Error):
S = input()

count = 1
answer = [0] * len(S)
# RLの切り替わるインデックスをマーク
n = 0
for i in range(len(S) - 1):
    if (S[i] == S[i + 1]):
        count += 1
    else:
        if (S[i + 1] == 'R'):
            # Lを割り振る
            answer[n] += count // 2
            answer[n + 1] += -(-count // 2)
            count = 1
        else:
            # Rを割り振る
            answer[i] += -(-count // 2)
            answer[i + 1] += count // 2
            count = 1
            n = i
    # 右端のLを割り振る
    if (i == len(S) - 2):
        answer[n] += count // 2
        answer[n + 1] += -(-count // 2)

for c in answer:
    print(f"{c} ", end='')
print()

Buggy submission (verdict: Runtime Error):
S = input()

count = 1
answer = [0] * len(S)
# RLの切り替わるインデックスをマーク
n = 0
for i in range(len(S) - 1):
    if (S[i] == S[i + 1]):
        count += 1
    else:
        if (S[i + 1] == 'R'):
            # Lを割り振る
            answer[n] += count // 2
            answer[n + 1] += -(-count // 2)
            count = 1
        else:
            # Rを割り振る
            answer[i] += -(-count // 2)
            answer[i + 1] += count // 2
            count = 1
            n = i
    # 右端のLを割り振る
    if (i == len(S) - 2):
        answer[n] += count // 2
        answer[n + 1] += -(-count // 2)

for c in answer:
    print(f"{c} ", end='')
Problem p02835 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a + b + c < 22:
    print('win')
else:
    print('bust')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b + c < 22:
    print('win')
else:
    ptint('bust')
Problem p02836 (python)

Fixed submission:
import sys

s = input()
if len(s) == 1:
    print(0)
    sys.exit(0)

sb = s[:len(s)//2]
if len(s) % 2 == 1:
    sa = s[len(s)//2+1:]
else:
    sa = s[len(s)//2:]
sa = sa[::-1]

cnt = 0
for i,b in enumerate(sb):
    if b != sa[i]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
s = input()
sb = s[:len(s)//2]
if len(s) % 2 == 1:
    sa = s[len(s)//2+1:]
else:
    sa = s[len(s)//2:]
sa = [::-1]
cnt = 0
for b in sb:
    for a in sa:
        if b != a:
            cnt += 1
        break
print(cnt)
Problem p02912 (python)

Fixed submission:
from math import ceil
from heapq import *

n, m = map(int, input().split())
a_s = [-int(a) for a in input().split()]
heapify(a_s)

for _ in range(m):
	amax = heappop(a_s)
	heappush(a_s, ceil(amax / 2))

res = sum([-heappop(a_s) for _ in range(n)])
print(res)

Buggy submission (verdict: Runtime Error):
import sys

n, m = map(int, input().split())
a_s = sorted(list(map(int, input().split())))

if len(a_s) == 1:
	for i in range(m):
		a_s[0] = a_s[0] // 2
	print(a_s[0])
	sys.exit()

amax1, amax2 = a_s[-1], a_s[-2]

for i in range(m):
	a_s[a_s.index(amax1)] = amax1 // 2
	if amax1 // 2 < amax2:
		a_s = sorted(a_s)
		amax1, amax2 = a_s[-1], a_s[-2]

res = sum(a_s)
print(res)
Problem p03805 (python)

Fixed submission:
from itertools import permutations as perm

n, m = map(int, input().split())

path = [[False] * n for _ in range(n)]
for i in range(n):
    path[i][i] = True

for _ in range(m):
    ai, bi = map(int, input().split())
    a, b = ai - 1, bi - 1
    path[a][b] = True
    path[b][a] = True

ans = 0
for ps in perm(range(1, n)):
    fst = ps[0]
    if not path[0][fst]:
        continue
    check = [path[i][j] for (i, j) in zip(ps, ps[1:])]
    if all(check):
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import permutations as perm

n, m = map(int, input().split())

path = [[False] * n for _ in range(n)]
for i in range(n):
    path[i][i] = True

for _ in range(n):
    ai, bi = map(int, input().split())
    a, b = ai - 1, bi -1
    path[a][b] = True
    path[b][a] = True

ans = 0
for ps in perm(range(1, n)):
    fst = ps[0]
    if not path[0][fst]:
        continue
    check = [path[i][j] for (i, j) in zip(ps, ps[1:])]
    if all(check):
        ans += 1

print(ans)
Problem p02860 (python)

Fixed submission:
a=int(input())
b=input()
if a%2!=0:
  print("No")
else:
  a//=2
  c=b[:a]
  d=b[a:]
  if c==d:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=input()
if a%2!=0:
  print("No")
else:
  a/=2
  c=b[:a]
  d=b[a:]
  if c==d:
    print("Yes")
  else:
    print("No")
Problem p03252 (python)

Fixed submission:
a=input()
b=input()
c={}
state=True
for i in range(len(a)):
  if b[i] not in c and a[i] not in c.values():
    c[b[i]]=a[i]
  if b[i] in c:
    if c[b[i]]!=a[i]:
      state=False
  else:
    state=False
if state:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c={}
state=True
for i in range(len(a)):
  if b[i] not in c:
    c[b[i]]=a[i]
  if b[i] in c:
    if c[b[i]]!=a[i]:
    state=False
  else:
    state=False
if state:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c={}
state=True
for i in range(len(a)):
  if b[i] not in c and a[i] not in c.values():
    c[b[i]]=a[i]
  if c[b[i]]!=a[i]:
    state=False
if state:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c={}
state=True
for i in range(len(a)):
  if (b[i] not in c) and (a[i] not in c):
    c[b[i]]=a[i]
    c[a[i]]=b[i]
  if c[b[i]]!=a[i]:
    state=False
if state:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c={}
state=True
for i in range(len(a)):
  if b[i] not in c and a[i] not in c:
    c[b[i]]=a[i]
    c[a[i]]=b[i]
  if c[b[i]]!=a[i]:
    state=False
if state:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c={}
state=True
for i in range(len(a)):
  b[i] not in c:
    c[b[i]]=a[i]
    c[a[i]]=b[i]
  if c[b[i]]!=a[i]:
    state=False
if state:
  print('Yes')
else:
  print('No')