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

Fixed submission:
a=input().split()
if int(a[0]) == int(a[1]):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
if int(a)==int(b):
  print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
a==b?print('Yes'):print('No')
Problem p02811 (python)

Fixed submission:
b,c = map(int, input().split())
if 500 * b >= c:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
print(input(), type(input()))
Problem p02812 (python)

Fixed submission:
a = input()
b = input()
print(b.count('ABC'))

Buggy submission (verdict: Runtime Error):
b, c = map(str, input().split())
print(c.count('ABC'))
Problem p02909 (python)

Fixed submission:
l = ['Sunny', 'Cloudy', 'Rainy', 'Sunny']
s = input()
flg = False
for i in l:
  if flg == True:
    print(i)
    exit()
  if s == i:
    flg = True

Buggy submission (verdict: Runtime Error):
l = ['Sunny', 'Cloudy', 'Rainy', 'Sunny']
s = input()
flg = Flase
for i in l:
  if flg == True:
    print(i)
    exit()
  if s == i:
    flg = True
Problem p02910 (python)

Fixed submission:
t = 'LRUD'
s = input()
for i in range(len(s)):
  if (i+1) % 2 == 1 and s[i] == 'L':
    print('No')
    exit()
  if (i+1) % 2 == 0 and s[i] == 'R':
    print('No')
    exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
t = 'LRUD'
s = input()
for i in range(len(s)):
  if i % 2 == 1 and s[i] == 'L':
    print('No')
    exit()
  if i % 2 == 0 and s[i] == 'R':
    print('No')
	exit()
print('Yes')
Problem p02922 (python)

Fixed submission:
a, b = map(int, input().split())
x = 0
outlet = 1
while outlet < b:
  outlet -= 1
  outlet += a
  x+=1
print(x)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
x = 0
outlet = 1
while outlet < b:
  --outlet
  outlet += a
  x+=1
print(x)
Problem p02945 (python)

Fixed submission:
a, b =map(int, input().split())
l=[
  a+b,
  a-b,
  a*b
]
print(max(l))

Buggy submission (verdict: Runtime Error):
a, b =map(int, input())
l=[
  a+b,
  a-b,
  a*b
]
print(max(l))
Problem p02641 (python)

Fixed submission:
X, N= [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

P_sub_abs = [abs(i - X) for i in P]
if(P_sub_abs.count(0) == 0):
    print(X)
    exit()
for i in range(1, 100):
    if(P_sub_abs.count(i) == 1):
        list = [X - i, X + i]
        list.remove(P[P_sub_abs.index(i)])
        print(list[0])
        exit()
    elif(P_sub_abs.count(i) == 0):
        print(X - i)
        exit()

Buggy submission (verdict: Runtime Error):
X, N= map(int,input().split())
P = map(int, input().split())

P_sub_abs = [abs(i - X) for i in P]
if(P_sub_abs.count(0) == 0):
    print(X)
    exit()
for i in range(1, 100):
    if(P_sub_abs.count(i) == 1):
        list = [X - i, X + i]
        list.remove(P[P_sub_abs.index(i)])
        print(list[0])
        exit()
    elif(P_sub_abs.count(i) == 0):
        print(X - i)
        exit()
Problem p02677 (python)

Fixed submission:
import math

a, b, h, m = [int(x) for x in input().split()]

#a, b, h, m = 3, 4, 11, 0

h_dig = 360 * (float(h) / 12) + 30 * (float(m) / 60)
m_dig = 360 * (float(m) / 60)

#print(str(h_dig) + " " +  str(m_dig))

abs_dig = abs(h_dig - m_dig)
if(abs_dig > 180):
    abs_dig = 360 - abs_dig

#print(abs_dig)

c = math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(abs_dig / 360 * 2 * math.pi))

print('{:.09f}'.format(c))

Buggy submission (verdict: Runtime Error):
a, b, h, m = [int(x) for x in input().split()]

#a, b, h, m = 3, 4, 11, 0

h_dig = 360 * (float(h) / 12) + 30 * (float(m) / 60)
m_dig = 360 * (float(m) / 60)

#print(str(h_dig) + " " +  str(m_dig))

abs_dig = abs(h_dig - m_dig)
if(abs_dig > 180):
    abs_dig = 360 - abs_dig

#print(abs_dig)

c = math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(abs_dig / 360 * 2 * math.pi))

print('{:.09f}'.format(c))
Problem p02641 (python)

Fixed submission:
x,n = map(int,input().split())
if n == 0:
    print(x)
else:
    p = list(map(int,input().split()))
    
    if x not in p:
        print(x)
    else:

        num1 = x

        for i in range(n):
            num1 += 1
            if num1 not in p:
                dif1 = num1- x
                break

        num2 = x
        for k in range(n):
            num2 -= 1
            if num2 not in p:
                dif2 = x - num2
                break

        if dif1 > dif2:
            print(num2)
        elif dif1 < dif2:
            print(num1)
        elif dif1 == dif2:
            print(num2)

Buggy submission (verdict: Runtime Error):
x,n = map(int,input().split())
if n == 0:
    print(x)
p = list(map(int,input().split()))

num1 = x

for i in range(n):
    num1 += 1
    if num1 not in p:
        dif1 = num1- x
        break

num2 = x
for k in range(n):
    num2 -= 1
    if num2 not in p:
        dif2 = x - num2
        break

if dif1 > dif2:
    print(num2)
elif dif1 < dif2:
    print(num1)
elif dif1 == dif2:
    print(num2)

Buggy submission (verdict: Runtime Error):
x,n = map(int,input().split())

p = list(map(int,input().split()))

num1 = x

for i in range(n):
    num1 += 1
    print(num1 in p)
    if num1 not in p:
        dif1 = num1- x
        break

num2 = x
for k in range(n):
    num2 -= 1
    if num2 not in p:
        dif2 = x - num2
        break

if dif1 > dif2:
    print(num2)
elif dif1 < dif2:
    print(num1)
elif dif1 == dif2:
    print(num2)
Problem p02848 (python)

Fixed submission:
s = int(input())
f = input()
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in f:
  ans += a[a.index(i)+s]

print(ans)

Buggy submission (verdict: Runtime Error):
s = int(input())
f = input()
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in f:
  ans += a[a.index(i)+s]

print(ans)

Buggy submission (verdict: Runtime Error):
s = int(input())
f = input()
a = "ABCDEFGHIJKLNMOPQRSTUVWXYZ"
ans = ""
for i in f:
  ans += a[a.index(i)+s]

print(ans)
Problem p02886 (python)

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

sum = 0

for i in range(n):
    for j in range(n):
        if i != j:
            sum += d[i] * d[j]

sum = sum // 2

print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = list(map(int, input().split()))

sum = 0

for i in range(n):
    for j in range(n):
        if i != j:
            sum += d[i] * d[J]

sum = sum // 2

print(sum)
Problem p02945 (python)

Fixed submission:
a,b = map(int,input().split())

if a+b >=  a-b and a+b >= a*b:
    print(a+b)

elif a-b >= a+b and a-b >= a*b:
    print(a-b)

elif a*b >= a+b and a*b >= a-b:
    print(a*b)

Buggy submission (verdict: Runtime Error):
a =int(input())
b = int(input())


if a+b >=  a-b and a+b >= a*b:
    print(a+b)

elif a-b >= a+b and a-b >= a*b:
    print(a-b)

elif a*b >= a+b and a*b >= a-b:
    print(a*b)
Problem p02999 (python)

Fixed submission:
a,b = map(int,input().split())

if a < b:
    print(0)

else:
    print(10)

Buggy submission (verdict: Runtime Error):
a,b = map(int input().split())

if a < b:
    print(0)

else:
    print(10)
Problem p03206 (python)

Fixed submission:
D = int(input())
if D == 22:
    print("Christmas Eve Eve Eve")
if D == 23:
    print("Christmas Eve Eve")
if D == 24:
    print("Christmas Eve")
if D == 25:
    print("Christmas")

Buggy submission (verdict: Runtime Error):
D = int(input())
if D == 22:
    print("Christmas Eve Eve Eve")
if D == 23:
    print("Christmas Eve Eve")
if D == 24:
    prtin("Christmas Eve")
if D == 25:
    print("Christmas")
Problem p03238 (python)

Fixed submission:
N = int(input())

if N == 1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A+B)

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

if N == 1:
    print("Hello World")
else:
    print(A+B)
Problem p02645 (python)

Fixed submission:
s = input()
print(s[:3])

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
light_power = list(map(int,input().split()))

max_power = [n for i in range(n)]
init_light = [0 for i in range(n)]
if k>50:
  k=42
for i in range(k):
  number_light = init_light
  for j,_power in enumerate(light_power):
    if _power == 0:
      number_light[j] += 1
    else:
      number_light = list(map(sum, zip(number_light, [1 if i>=(j+1-_power-0.5) and (j+1+_power+0.5)>=i else 0 for i in range(1,n+1)])))
  light_power = number_light
  if light_power == max_power:
    break
print(*light_power)
Problem p02646 (python)

Fixed submission:
a,v = map(float,input().split())
b,w = map(float,input().split())
t = float(input())
first_distance = abs(b-a)
speed = v-w
t_position = first_distance - speed*t
if t_position <= 0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
first_distance = abs(b-a)
speed = v-w
t_position = first_distance - speed*t
if t_position <= 0:
  print("YES")
else:a
  print("NO")
Problem p02657 (python)

Fixed submission:
a,b = map(int,input().split())
print(a*b)

Buggy submission (verdict: Runtime Error):
from collections import Counter

def prime_factor(num):
  factor_list = []
  while num % 2 == 0:
    factor_list.append(2)
    num /= 2
  f = 3
  while f * f <= num:
    if num % f == 0:
      factor_list.append(f)
      num /= f
    else:
      f += 2
  if num!=1:
    factor_list.append(num)
  return factor_list

def get_count(c):
  ans = 0
  _max = c
  for i in range(1,c+1):
    if i <= _max:
      ans += 1
      _max -= i
    else:
      break
  return ans
a = int(input())
counter = Counter(prime_factor(a))
ans = 0
for i in counter:
  ans += get_count(counter[i])
print(ans)
Problem p02741 (python)

Fixed submission:
def main():
  l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
  K = int(input())

  print(l[K-1])

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from math import sqrt
from decimal import *

def main():
  A,B,C =   map(int, input().split())

  getcontext().prec = 20
  
  a = int(Decimal(A).sqrt())
  b = int(Decimal(B).sqrt())
  c = int(Decimal(C).sqrt())

  if a + b < c:
    print('Yes')
  else:
    print('No')

if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]


def main():
    K = int(input())

    print(l[K])

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

K = int(input())

print(l[K])
Problem p02801 (python)

Fixed submission:
c = str(input())

print(chr(ord(c)+1))

Buggy submission (verdict: Runtime Error):
c = input()
print chr(ord(c) + 1)
Problem p02683 (python)

Fixed submission:
import numpy as np

N,M,X=map(int,input().split())

listC=[]
listall=[]

for i in range(N):
    listC.append(list(map(int,input().split())))

for i in range(2**N):
    total=np.zeros(M+1)
    for j in range(N):
        
        if ((i >> j) & 1):
            total=total+np.array(listC[j])
            #print(total)
    listall.append(list(total))
            


#print(listall)
ans=[]
for i in range(len(listall)):
    flag=True
    for j in range(M):
        if listall[i][j+1] < X:
            #print(j,listall[i][j+1])
            flag=False
        if j==(M-1) and flag==True:
            ans.append(listall[i][0])

if len(ans)>0:
    print(int(min(ans)))
else:
    print("-1")

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M,X = map(int,input().split())

clist=[]
for i in range(N):
    clist.append(list(map(int,input().split())))

#print(clist)

total_all=[]
for i in range(2**N):
    total=np.zeros(M+1)
    for j in range(N):
        
        # iを2進数表記した場合の下から数えてj番目が1ならtrue
        if ((i >> j) & 1):
            total=total+np.array(clist[j])
    total_all.append(list(total))

#print(total_all)
ans=[]
#print(total_all[1][1:M+1])

for i in range(len(total_all)):
    if min(total_all[i][1:M])>=X:
        ans.append(total_all[i][0])

if len(ans)>=1:
    print(int(min(ans)))
else:
    print("-1")

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M,X = map(int,input().split())

clist=[]
for i in range(N):
    clist.append(list(map(int,input().split())))

#print(clist)

total_all=[]
for i in range(2**N):
    total=np.zeros(M+1)
    for j in range(N):
        
        # iを2進数表記した場合の下から数えてj番目が1ならtrue
        if ((i >> j) & 1):
            total=total+np.array(clist[j])
    total_all.append(list(total))

#print(total_all)
ans=[]
for i in range(len(total_all)):
    if min(total_all[i][1:M])>=10:
        ans.append(total_all[i][0])

if len(ans)>=1:
    print(int(min(ans)))
else:
    print("-1")
Problem p02717 (python)

Fixed submission:
X,Y,Z=map(int,input().split())
print(Z,X,Y)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
list_A=input().split()
for i in range(len(list_A)):
    list_A[i]=int(list_A[i])
A =int(sum(list_A)/(4*M))
if M<len([i for i in list_A if i> A]):
    print("Yes")
else:
    print("No")
Problem p02761 (python)

Fixed submission:

N,M=map(int,input().split())
slist=[]
for i in range(M):
    slist.append(list(map(int,input().split())))
ans=["0"]*N


for i in range(len(slist)):
    #print("i",i)
    if ans[slist[i][0]-1] == "0":
        ans[slist[i][0]-1] = slist[i][1]
    elif ans[slist[i][0]-1] == slist[i][1]:
        continue
    else:
        ans=["-1"]
        break

#print(ans)

if N>=2:
    if ans[0]=="0":
        ans[0]=1
    elif ans[0]==0:
        ans=["-1"]


    
for i in range(len(ans)):
    if ans[i]=="0":
        ans[i]=0

print(*ans,sep=(""))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
slist=[]
for i in range(M):
    slist.append(list(map(int,input().split())))

ans=["0"]*N

for i in range(N):
    if ans[slist[i][0]-1]=="0":
        ans[slist[i][0]-1]=slist[i][1]
    elif ans[slist[i][0]-1]!=slist[i][1]:
        ans=["-1"]
        break



if N>1:
    if ans[0]=="0":
        ans[0]=1
    elif ans[0]==0:
        ans=["-1"]
        

for i in range(len(ans)):
    if ans[i]=="0":
        ans[i]=0

print(*ans,sep=(""))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
slist=[]
for i in range(M):
    slist.append(list(map(int,input().split())))

ans=["0"]*N

for i in range(N):
    if ans[slist[i][0]-1]=="0":
        ans[slist[i][0]-1]=slist[i][1]
    elif ans[slist[i][0]-1]!=slist[i][1]:
        ans=["-1"]
        break



if N>1:
    if ans[0]=="0":
        ans[0]=1
    elif ans[0]==0:
        ans=["-1"]
if ans !=["-1"]:
    for i in range(N):
        if ans[i]=="0":
            ans[i]=0

print(*ans,sep=(""))
Problem p02772 (python)

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

Flag=True
for i in range(N):
    if Alist[i]%2==0:
        if Alist[i]%3==0 or Alist[i]%5==0:
            continue
        else:
            Flag=False

if Flag:
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
N =int(input())
Alist=list(map(int,input().split()))

Flag=True
for i in range(N):
    print(i)
    if Alist[i]%2==0:
        if Alist[i]%3==0 or Alist[i]%5==0:
            continue
        else:
            Flag=False

if Flag:
    print("APPROVED")
else:
    print("DENIED)
Problem p04044 (python)

Fixed submission:
N,L =input().split()
listA=[]
for i in range(int(N)):
    listA.append(input())

print(*sorted(listA),sep="")

Buggy submission (verdict: Runtime Error):
n,l = map(int,input().split())
s = sort([input() for i in range(n)])
print(*s,sep="")
Problem p02641 (python)

Fixed submission:
x, n = map(int, input().split())
p = set(map(int, input().split()))


ans = 0
i = 0
while True:
    if (x - i) not in p:
        ans = x - i
        break
    elif (x + i) not in p:
        ans = x + i
        break
    i += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np


def getNearestValue(li, num):
    idx = np.abs(np.array(li) - num).argmin()
    return li[idx]


x, n = map(int, input().split())
p = list(map(int, input().split()))


ans = 0
print(p)
i = 0
while True:
    mi = getNearestValue(p, x - i)
    ma = getNearestValue(p, x + i)
    if mi or ma:
        break
    i += 1

print(mi if mi < ma else ma)
Problem p02657 (python)

Fixed submission:
a, b = map(int, input().split())

print(a * b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

if 0 in a:
    print(0)
    exit()

limit = 10**18
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > limit:
        print(-1)
        exit()

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

if 0 in a:
    print(0)
    exit()

ans = 1
for i in range(n):
    ans *= a[i]
    if ans > 1000000000000000000:
        print(-1)
        exit()

print(ans)
Problem p02664 (python)

Fixed submission:
t = list(input())
tl = len(t)

for i in range(tl):
    if t[i] != '?':
        continue

    if tl == 1:
        t[i] = 'D'
    elif i == tl - 1:
        t[i] = 'D'
    elif t[i-1] == 'P':
        t[i] = 'D'
    elif t[i+1] == '?':
        t[i] = 'P'
    elif t[i+1] == 'D':
        t[i] = 'P'
    else:
        t[i] = 'D'

print(''.join(t))

Buggy submission (verdict: Runtime Error):
t = list(input())
tl = len(t)

for i in range(tl):
    if t[i] != '?':
        continue

    if tl == 1:
        t[i] = 'D'
    elif t[i-1] == 'P':
        t[i] = 'D'
    elif t[i+1] == '?':
        t[i] = 'P'
    elif t[i+1] == 'D':
        t[i] = 'P'
    else:
        t[i] = 'D'

print(''.join(t))
Problem p02683 (python)

Fixed submission:
def bit():
    n, m, x = map(int, input().split())
    books = [list(map(int, input().split())) for _ in range(n)]
    ans = 99999999999999999
    for i in range(2 ** n):
        cost = 0
        level = [0] * (m)
        for j in range(n):
            if ((i >> j) & 1):
                cost += books[j][0]
                for k in range(m):
                    level[k] += books[j][k+1]

        if level and min(level) >= x:
            ans = min(ans, cost)

    if ans == 99999999999999999:
        print(-1)
    else:
        print(ans)


if __name__ == "__main__":
    bit()

Buggy submission (verdict: Runtime Error):
def test():
    n, m, x = map(int, input().split())
    books = [list(map(int, input().split())) for _ in range(n)]
    ans = 99999999999999999
    for i in range(2 ** n):
        cost = 0
        level = [0] * (m)
        for j in range(n):
            if ((i >> j) & 1):
                cost += books[j][0]
                for k in range(m):
                    level[k] += books[j][k+1]

        if level and min(*level) >= x:
            ans = min(ans, cost)

    if ans == 99999999999999999:
        print(-1)
    else:
        print(ans)


if __name__ == "__main__":
    test()

Buggy submission (verdict: Runtime Error):
import sys


def test():
    n, m, x = map(int, input().split())
    books = [list(map(int, input().split())) for _ in range(n)]
    ans = 12345678
    is_ok = False
    for i in range(2 ** n):
        cost = 0
        level = [0] * (m)
        for j in range(n):
            if ((i >> j) & 1):
                cost += books[j][0]
                for k in range(m):
                    level[k] += books[j][k+1]

        if min(*level) >= x:
            ans = min(ans, cost)
            is_ok = True

    if is_ok:
        print(ans)
    else:
        print(-1)


if __name__ == "__main__":
    test()
Problem p02713 (python)

Fixed submission:
import math
k=int(input())
sum=0
for i in range(1,k+1):
 for j in range(1,k+1):
  a=(math.gcd(i,j))
  for l in range(1,k+1):
   sum=sum+(math.gcd(a,l))
print(sum)

Buggy submission (verdict: Runtime Error):
import math
k=int(input())
sum=0
for i in range(1,k+1):
 for j in range(1,k+1):
  for l in range(1,k+1):
   sum=sum+(math.gcd(i,j,l))
print(sum)
Problem p02641 (python)

Fixed submission:
x,n=map(int,input().split())
a = list(map(int,input().split()))

flag=True
k = 0

while(True):
    b = x - k
    c = x + k
    if(not(b in a)):
        print(b)
        flag = False
        break
    elif(not(c in a) and flag):
        print(c)
        break
    k = k + 1

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
if(n!=0):
    a = list(map(int,input().split()))
flag=True
k = 0

while(True):
    b = x - k
    c = x + k
    if(not(b in a)):
        print(b)
        break
    elif(not(c in a)):
        print(c)
        break
    k = k + 1

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
if(n!=0):
    a = list(map(int,input().split()))
else:
    print(x)
flag=True
k = 0

while(True):
    b = x - k
    c = x + k
    if(not(b in a)):
        print(b)
        break
    elif(not(c in a)):
        print(c)
        break
    k = k + 1
Problem p02658 (python)

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

ans=1

if 0 in a:
    print(0)
    exit()

for i in a:
   ans*=i
   if ans>10**18:
    print(-1)
    exit()


print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))

ans=1

for i in a:
  ans*=i


  if ans>10**18:
    print(-1)
    else:
      print(ans)
Problem p02817 (python)

Fixed submission:
S, T = input().split()
print(T + S)

Buggy submission (verdict: Runtime Error):
S, T = input().split()
print(T + S)
Problem p04013 (python)

Fixed submission:
n, a = [int(i) for i in input().split()]

x = [int(i) for i in input().split()] 
y = [int(i)-a for i in x] 


max = max(x)

dp = [[0 for _ in range(2*n*max+1)] for _ in range(n+1)]

dp[0][n*max] = 1 

for i in range(1, n+1):
	for j in range(2*n*max+1):
		if j - y[i-1] < 0 or j - y[i-1] > 2*n*max:
			dp[i][j] = dp[i-1][j]
		else: 
			dp[i][j] = dp[i-1][j] + dp[i-1][j-y[i-1]]

result = dp[n][n*max]-1

print(result)

Buggy submission (verdict: Runtime Error):
n, a = [int(i) for i in input().split()]
x = [int(i)-a for i in input().split()] 

max = max(x)

dp = [[0 for _ in range(2*n*max+1)] for _ in range(n+1)]

dp[0][n*max] = 1 

for i in range(1, n+1):
	for j in range(2*n*max+1):
		if j - x[i-1] < 0 or j - x[i-1] > 2*n*max:
			dp[i][j] = dp[i-1][j]
		else: 
			dp[i][j] = dp[i-1][j] + dp[i-1][j-x[i-1]]

print(dp[n][n*max]-1)

Buggy submission (verdict: Runtime Error):
n, a = [int(i) for i in input().split()]
x = [int(i)-a for i in input().split()] 

max = max(x)

dp = [[0 for _ in range(2*n*max+1)] for _ in range(n+1)]

dp[0][n*max] = 1 

for i in range(1, n+1):
	for j in range(2*n*max+1):
		if j - x[i-1] < 0 or j - x[i-1] > 2*n*max:
			dp[i][j] = dp[i-1][j]
		else: 
			dp[i][j] = dp[i-1][j] + dp[i-1][j-x[i-1]]

print(dp[n][n*max]-1)







# # def function(i, j, x):
# 	print(0)
# 	if i == 0 and j == 0:
# 		return 1
# 	elif i == 0 and j == x[0]:
# 		return 1
# 	else:
# 		return function(i-1, j, x) + function(i-1, j-x[i], x)

Buggy submission (verdict: Runtime Error):
n, a = [int(i) for i in input().split()]
x = [int(i)-a for i in input().split()] 

max = max(x)

dp = [[0 for _ in range(2*n*max)] for _ in range(n)]

dp[0][n*max+x[0]] = 1
dp[0][n*max] = 1 

for i in range(1, n):
	for j in range(2*n*max):
		if j - x[i] < 0 or j - x[i] >= 2*n*max:
			dp[i][j] = dp[i-1][j]
		else: 
			dp[i][j] = dp[i-1][j] + dp[i-1][j-x[i]]

print(dp[n-1][n*max]-1)







# # def function(i, j, x):
# 	print(0)
# 	if i == 0 and j == 0:
# 		return 1
# 	elif i == 0 and j == x[0]:
# 		return 1
# 	else:
# 		return function(i-1, j, x) + function(i-1, j-x[i], x)