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

Fixed submission:
N = int(input())
if(N == 1):
  A1,B1 = map(int,input().split())
  print(str(A1+B1))
  exit()
for i in range(N-1):
  if(i == 0):
    A1,B1 = map(int,input().split())
    A2,B2 = map(int,input().split())
    if(A1 <= A2):
      MA = A2
      MB = B2
    else:
      MA = A1
      MB = B1
    A1 = A2
    B1 = B2
  else:
    A2,B2 = map(int,input().split())
    if(MA <= A2):
      MA = A2
      MB = B2
    A1 = A2
    B1 = B2
print(str(MA + MB))

Buggy submission (verdict: Runtime Error):
N = int(input())
if(N == 1):
  A1,B1 = map(int,input().split())
  print(str(A1+B1))
for i in range(N-1):
  if(i == 0):
    A1,B1 = map(int,input().split())
    A2,B2 = map(int,input().split())
    if(A1 <= A2):
      MA = A2
      MB = B2
    else:
      MA = A1
      MB = B1
    A1 = A2
    B1 = B2
  else:
    A2,B2 = map(int,input().split())
    if(MA <= A2):
      MA = A2
      MB = B2
    A1 = A2
    B1 = B2
print(str(MA + MB))
Problem p03681 (python)

Fixed submission:
import math
N,M = map(int,input().split())
if(abs(N - M) >= 2):
  print("0")
else:
  if(N != M):
    print(str(((math.factorial(N) * math.factorial(M)) % (10 ** 9 + 7))))
  else:
    print(str(((math.factorial(N) * math.factorial(M))* 2 % (10 ** 9 + 7))))

Buggy submission (verdict: Runtime Error):
import math
N,M = int(input())
if(N == 1 or M == 1):
  print("0")
else:
  print(str(((math.factorial(N) * math.factorial(M))% 10 ** 9 + 7)))
Problem p03698 (python)

Fixed submission:
S = input()
alpha = lambda c:chr(c+96)
List = []
for i in range(len(S)):
  tmp = S[i]
  List.append(tmp)
for k in range(1,27):
  if(List.count(alpha(k)) <= 1):
    pass
  else:
    print("no")
    exit()
print("yes")

Buggy submission (verdict: Runtime Error):
S = input()
alpha = lambda c:chr(c+96)
List = []
for i in range(len(S)):
  tmp = S[i]
  List.append[tmp]
for k in range(1,27):
  if(List.count(alpha(k)) <= 1):
    pass
  else:
    print("no")
    exit()
print("yes")
Problem p03827 (python)

Fixed submission:
N = int(input())
S = input()
x = 0
length = len(S)
List = [0]
for i in range(length):
  if(S[i] == "I"):
    x += 1
    List.append(x)
  else:
    x -= 1
    List.append(x)
print(str(max(List)))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
x = 0
length = len(S)
List = [0]
for i in range(length):
  if(S[i] == I):
    x += 1
    List.append(x)
  else:
    x -= 1
    List.append(x)
print(max(List))
Problem p02765 (python)

Fixed submission:
n,r = input().split()
n = int(n)
r = int(r)

if n >= 10:
  i = r
else:
  i = r + 100 * (10 - n)
print(i)

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

if n >= 10:
  i = r
else:
  i = r + 100 * (10 - n)
print(i)
Problem p03106 (python)

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

def ans120(A:int, B:int, K:int):
    if A>=B:
        n=A
    else:
        n=B
    ans_list=[]
    for i in range(1,n+1):
        if A%i==0 and B%i==0:
            ans_list.append(i)
    return ans_list[-K]

print(ans120(A,B,K))

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())

def ans120(A:int, B:int, K:int):
    l=sorted([A,B])
    ans_list=[]
    for i in range(1,l[1]):
        if A%i==0 and B%i==0:
            ans_list.append(i)
    return ans_list[-K]

print(ans120(A,B,K))

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())

def ans120(A:int, B:int, K:int):
    l=sorted([A,B])
    ans_list=[1]
    for i in range(2,l[1]):
        if A%i==0 and B%i==0:
            ans_list.append(i)
    return ans_list[-K]

print(ans120(A,B,K))

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())

def ans120(A:int, B:int, K:int):
    l=sorted([A,B])
    ans_list=[1]
    for i in range(2,l[1]):
        if A%i==0 and B%i==0:
            ans_list.append(i)
    return ans_list[-K]

print(ans120(A,B,K))

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())

def ans120(A:int, B:int, K:int):
    l=sorted([A,B])
    ans_list=[1]
    for i in range(2,l[1]):
        if A%i==0 and B%i==0:
            ans_list.append(i)
    return ans_list[K-1]

print(ans120(A,B,K))
Problem p03477 (python)

Fixed submission:
A,B,C,D=map(int,input().split())
if A+B>C+D:
  print("Left")
elif A+B<C+D:
    print("Right")
else:
  print("Balanced")

Buggy submission (verdict: Runtime Error):
A,B,C,D=map(int,input(),split())
if A+B>C+D:
  print("Left")
elif:
  A+B<C+D:
    print("Right")
else:
  print("Balanced")
Problem p03485 (python)

Fixed submission:
import math
a,b=map(int,input().split())
print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
a
Problem p03543 (python)

Fixed submission:
N=input()
j_count=0
for i in range(0,3):
    if N[i]==N[i+1]:
        j_count+=1
if j_count>=2 and N[1]==N[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=input()
j_count=0
for i in range(0,3):
    if N[i]==N[i+1]:
        j_count+=1

if j_count>=2　and N[1]==N[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=input()#整数Nを受け取る
#Nのi文字目とi＋1文字目が同じであればカウントを増やす。
j_count=0
for i in range(0,3):
    if N[i]==N[i+1]:
        j_count+=1

#カウントが2以上かつ2文字目＝3文字目であればYes、でなければNoを返す。
if j_count>=2　and N[1]==N[2]:
    print("Yes")
else:
    print("No")
Problem p03547 (python)

Fixed submission:
A=1
B=2
C=3
D=4
E=5
F=6
X,Y=input().split()
if X<Y:
  print("<")
elif X>Y:
  print(">")
elif X==Y:
  print("=")

Buggy submission (verdict: Runtime Error):
A=1
B=2
C=3
D=4
E=5
F=6
X,Y=input().split()
if X<Y:
  pritn("<")
elif X>Y:
  print(">")
elif X==Y:
  print("=")
Problem p03657 (python)

Fixed submission:
A,B=map(int,input().split())
if A%3==0 or B%3==0 or (A+B)%3==0:
  print("Possible")
else:
  print("Impossible")

Buggy submission (verdict: Runtime Error):
A,B=map(int.input().split())
if A%3==0 or B%3==0 or (A+B)%3==0:
  print("Possible")
else:
  print("Impossible")
Problem p03693 (python)

Fixed submission:
r,g,b=input().split()
if int(r+g+b)%4==0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
r,g,b=input().split()
if int(t+g+b)%4==0:
  print("YES")
else:
  print("NO")
Problem p03711 (python)

Fixed submission:
x,y=map(int,input().split())
group_A=[1,3,5,7,8,10,12]
group_B=[4,6,9,11]
if x in group_A and y in group_A :
  print("Yes")
elif x in group_B and y in group_B :
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
group_A=[1,3,5,7,8,10,12]
group_B=[4,6,9,11]
if x in group_A = True and y in group_A =True:
  print("Yes")
elif x in group_B = True and y in group_B =True:
  print("Yes")
else:
  print("No")
Problem p03777 (python)

Fixed submission:
a,b=input().split()
if a==b:
  print("H")
else:
  print("D")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if a=b:
  print("H")
else:
  print("D")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a=b:
  print("H")
else:
  print("D")
Problem p03844 (python)

Fixed submission:
A,c,B=input().split()
A=int(A)
B=int(B)
if c=="+":
  print(A+B)
elif c=="-":
  print(A-B)

Buggy submission (verdict: Runtime Error):
A,c,B=input().split()
if c=="+":
  print(int(A)+int(B)):
elif c=="-":
  print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
A,c,B=input().split()
if c=="+":
  print(A+B):
elif c=="-":
  print(A-B)
Problem p03860 (python)

Fixed submission:
a,s,c=map(str,input().split())
print(("A"+s[0]+"C"))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(len(set([a,b,c])))
Problem p04043 (python)

Fixed submission:
A,B,C=map(int,input().split())
if sorted([A,B,C])==[5,5,7]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().sprit())
if sorted[A,B,C]=[5,5,7]:
  print("YES")
else:
  print("NO")
Problem p02582 (python)

Fixed submission:
S = list(input())
ans = 0
ls = []
for i in S:
    if i == 'R':
        ans += 1
    else:
        ans = 0
    ls.append(ans)
print(max(ls))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
Pls = [0] + list(map(int,input().split()))
Cls = [0] + list(map(int,input().split()))
used = [False]*(N+1)
loopmax = []
for i in range(1,N+1):
    loop = [Cls[i]]
    pi = Pls[i]
    if used[i]:
        continue
    else:
        while pi != i:
            loop.append(Cls[pi])
            used[pi] = True
            pi = Pls[pi]
        if sum(loop) > 0:
            max1 = (K//len(loop))*sum(loop)
            lenloop = len(loop)
            rm = (K-1) % lenloop + 1
            max3 = -10**9
            for k in range(1,rm + 1):
                max2 = sum(loop[:k])
                for j in range(lenloop):
                    max2 += -loop[j] + loop[(k + j) % lenloop]
                    max3 = max(max2,max3)
            loopmax.append(max3 + max1)
        else:
            max1 = 0
            lenloop = len(loop)
            rm = (K-1) % lenloop +1
            max3 = -10**9
            for k in range(1,rm + 1):
                max2 = sum(loop[:k])
                for j in range(lenloop):
                    max2 += -loop[j] + loop[(k + j) % lenloop]
                    max3 = max(max2,max3)
            loopmax.append(max3 + max1)
print(max(loopmax))
Problem p02608 (python)

Fixed submission:
N = int(input())
Pls = [0]*(10**4+1)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            k = x**2+y**2+z**2+x*y+y*z+z*x
            if k <= 10**4:
                Pls[k] = Pls[k] + 1
Pls.pop(0)
for i in range(N):
    print(Pls[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
Pls = [0]*(10**4+1)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            k = x**2+y**2+z**2+x*y+y*z+z*x
            if k <= 10**4:
                Pls[k] = Pls[k] + 1
Pls.pop(0)
for i in range(N+1):
    print(Pls[i])
Problem p02642 (python)

Fixed submission:
N = int(input())
ls = list(map(int,input().split()))
    
Pls = [0] * (10**6+1)

for i in ls:
    Pls[i] += 1

ii = 0
for j in range(len(Pls)):
    if Pls[j] == 0:
        continue
    elif Pls[j] == 1:
        ii += 1
        t = 2*j
        while t <= 10**6:
            Pls[t] = 0
            t += j
    else:
        t = 2*j
        while t <= 10**6:
            Pls[t] = 0
            t += j

print(ii)

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = list(map(int,input().split()))
    
Pls = [0] * (10**6+1)

for i in ls:
    Pls[i] += 1

ii = 0
for j in range(len(Pls)):
    if Pls[j] == 0:
        continue
    elif Pls[j] == 1:
        ii += 1
        t = 2*j
        while t <= 10**6+1:
            Pls[t] = 0
            t += j
    else:
        t = 2*j
        while t <= 10**6+1:
            Pls[t] = 0
            t += j

print(ii)

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = list(map(int,input().split()))
    
Pls = [0] * (10**6+1)

for i in ls:
    Pls[i] = 1

ii = 0
for j in range(len(Pls)):
    if Pls[j] == 0:
        continue
    else:
        ii += 1
        t = 2*j
        while t <= 10**6+1:
            Pls[t] = 0
            t += j

print(ii)

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = list(map(int,input().split()))
    
ls1 = sorted(ls)
ii = 0
if ls[0] == ls[1]:
    ii = ii + 1
for i in range(N):
    for j in ls1[:i]:
        if ls1[i] % j == 0:
            ii += 1
            break
        elif ls1[i]/2 <= j :
            break

print(N-ii)
Problem p02802 (python)

Fixed submission:
N,M = map(int,input().split())
ls2 = []
for i in range(M):
    A,B = map(str,input().split())
    ls = [int(A)-1,B]
    ls2.append(ls)

Pena = 0
corr = 0

#ls3 = sorted(ls2, key=lambda x: x[0])
lsans = [[] for i in range(N)]
for i in range(M):
    lsans[ls2[i][0]].append(ls2[i][1])

for i in range(N):
    if 'AC' in lsans[i]:
        for ans in lsans[i]:
            if ans == 'WA':
                Pena += 1
            if ans == 'AC':
                corr += 1
                break
print(corr,Pena)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
ls2 = []
for i in range(M):
    A,B = map(str,input().split())
    ls = [int(A)-1,B]
    ls2.append(ls)

Pena = 0
corr = 0

ls3 = sorted(ls2, key=lambda x: x[0])
lsans = [[] for i in range(M)]
for i in range(M):
    lsans[ls2[i][0]].append(ls2[i][1])

for i in range(M):
    if bool(lsans[i]):
        for ans in lsans[i]:
            if ans == 'WA':
                Pena += 1
            if ans == 'AC':
                corr += 1
                break
print(corr,Pena)
Problem p02923 (python)

Fixed submission:
N = int(input())
ls = list(map(int,input().split()))
ans=0
n=0
nls = []
for i in range(N-1):
    if ls[i] >= ls[i+1]:
        n += 1 
    elif ls[i] < ls[i+1]:
        ans = max(ans,n)
        n = 0
    
    if i==N-2:
        ans = max(ans,n)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = list(map(int,input().split()))
n=0
nls = []
for i in range(N-1):
    if ls[i] >= ls[i+1]:
        n += 1 
    elif ls[i] < ls[i+1]:
        nls.append(n)
        n = 0
    
    if i==N-2:
        nls.append(n)

print(max(nls))

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = list(map(int,input().split()))
n=0
nls = []
for i in range(N-1):
    if ls[i] >= ls[i+1]:
        n += 1 
    elif ls[i] < ls[i+1]:
        nls.append(n)
        n = 0
    
    if i==N-2:
        nls.append(n)

print(max(nls))
Problem p03274 (python)

Fixed submission:
import sys
N,K = map(int,input().split())
lsx = list(map(int,input().split()))
if 0 in lsx:
    K = K-1
    lsx.remove(0)
if bool(lsx) == False or K == 0:
    print(0)
    sys.exit()
lshu = []
sei = len(lsx)
for i in range(len(lsx)):
    if lsx[i] < 0:
        lshu.append(lsx[i])
    else:
        sei = i
        break
lssei = lsx[sei:]
lenhu = len(lshu)
lensei = len(lssei)
lshu2 = [abs(lshu[i]) for i in range(lenhu-1,-1,-1)]
dishu = [0] + lshu2
dissei = [0] + lssei
ans = 10*10**8
for i in range(K+1):
    if i <= lenhu and K-i <= lensei:
        ans = min(ans,2*dishu[i]+dissei[K-i],dishu[i]+2*dissei[K-i])
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
N,K = map(int,input().split())
lsx = list(map(int,input().split()))
if 0 in lsx:
    K = K-1
    lsx.remove(0)
if bool(lsx) == False or K == 0:
    print(0)
    sys.exit()
lshu = []
for i in range(len(lsx)):
    if lsx[i] < 0:
        lshu.append(lsx[i])
    else:
        sei = i
        break
lssei = lsx[sei:]
lenhu = len(lshu)
lensei = len(lssei)
lshu2 = [abs(lshu[i]) for i in range(lenhu-1,-1,-1)]
dishu = [0] + lshu2
dissei = [0] + lssei
print(dissei,dishu)
ans = 10*10**8
for i in range(K):
    if i <= lenhu and K-i <= lensei:
        ans = min(ans,2*dishu[i]+dissei[K-i],dishu[i]+2*dissei[K-i])
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
N,K = map(int,input().split())
lsx = list(map(int,input().split()))
if 0 in lsx:
    K = K-1
    lsx.remove(0)
if bool(lsx) == False or K == 0:
    print(0)
    sys.exit()
lshu = []
for i in range(N):
    if lsx[i] < 0:
        lshu.append(lsx[i])
    else:
        sei = i
        break
lssei = lsx[sei:]
lenhu = len(lshu)
lensei = len(lssei)
lshu2 = [abs(lshu[i]) for i in range(lenhu-1,-1,-1)]
dishu = [0] + lshu2
dissei = [0] + lssei
ans = 10*10**8
for i in range(K):
    if i <= lenhu and K-i <= lensei:
        ans = min(ans,2*dishu[i]+dissei[K-i],dishu[i]+2*dissei[K-i])
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
N,K = map(int,input().split())
lsx = list(map(int,input().split()))
if 0 in lsx:
    K = K-1
    lsx.remove(0)
if bool(lsx) == False or K == 0:
    print(0)
    sys.exit()
lshu = []
for i in range(N):
    if lsx[i] < 0:
        lshu.append(lsx[i])
    else:
        sei = i
        break
lssei = lsx[sei:]
lenhu = len(lshu)
lensei = len(lssei)
lshu2 = [abs(lshu[i]) for i in range(lenhu-1,-1,-1)]
dishu = [0] + lshu2
dissei = [0] + lssei
ans = 2*10**8
for i in range(K):
    if i <= lenhu and K-i <= lensei:
        ans = min(ans,2*dishu[i]+dissei[K-i],dishu[i]+2*dissei[K-i])
print(ans)
Problem p03308 (python)

Fixed submission:
N = int(input())
ls = list(map(int,input().split()))
print(max(ls)-min(ls))

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = map(int,input().split())
print(max(ls)-min(ls))
Problem p03316 (python)

Fixed submission:
N = input()
num = int(N)
Nls = list(N)
sum1 = sum([int(i) for i in Nls])
if num%sum1 == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = input()
num = int(N)
Nls = list(N)
sum1 = sum([int(i) for in Nls])
if num%sum1 == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = input()
num = int(N)
Nls = list(N)
sum1 = sum(Nls)
if num%sum1 == 0:
  print('Yes')
else:
  print('No')
Problem p03324 (python)

Fixed submission:
D, N = map(int,input().split())
ls = [0]*2000000
for i in range(1,2*10**6):
    if i % 100 == 0:
        ls[i] = 1
    if i % 10000 == 0:
        ls[i] = 2
    if i % 1000000 == 0:
        ls[i] = 3
ii = 0
for i in range(1,2*10**6):
    if ls[i] == D:
        ii += 1
    if ii == N:
        ans = i
        break
print(ans)

Buggy submission (verdict: Runtime Error):
D, N = map(int,input().split())
ls = [0]*1000000
for i in range(1,10**6):
    if i % 100 == 0:
        ls[i] = 1
    if i % 10000 == 0:
        ls[i] = 2
ii = 0
for i in range(1,10**6):
    if ls[i] == D:
        ii += 1
    if ii == N:
        ans = i
        break
print(ans)
Problem p03360 (python)

Fixed submission:
ls = list(map(int,input().split()))
K = int(input())
ls.sort()
ans = ls[0]+ls[1]+ls[2]*2**K
print(ans)

Buggy submission (verdict: Runtime Error):
ls = map(int,input().split())
K = int(input())
ls.sort()
ans = ls[0]+ls[1]+ls[2]*2**K
print(ans)
Problem p03502 (python)

Fixed submission:
N = input()
Nnum = int(N)
Nls = list(N)
Nls = [int(i) for i in Nls]
FN = sum(Nls)
if Nnum%FN == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = input()
Nnum = int(N)
Nls = list(N)
FN = sum(Nls)
if Nnum%FN == 0:
  print('Yes')
else:
  print('No')
Problem p03545 (python)

Fixed submission:
lsnum = list(input())
lsnum1 = [int(i) for i in lsnum]
ls = ['+','-']
for i in range(2 ** 3):
    ans = lsnum1[0]
    for j in range(3):  # このループが一番のポイント
        if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
           ans += lsnum1[j+1]
        else:
            ans -= lsnum1[j+1]
    if ans == 7:
        bit = i
        break
ans2 = lsnum[0]
for i in range(3):
    if ((bit >> i) & 1):
        ans2 += '+'+lsnum[i+1]
    else:
        ans2 += '-'+lsnum[i+1]
print(ans2+'=7')

Buggy submission (verdict: Runtime Error):
lsnum = list(input())
lsnum1 = [int(i) for i in lsnum]
ls = ['+','-']
for i in ls:
    if i == '+':
        ans7 = lsnum1[0] + lsnum1[1]
    else:
        ans7 = lsnum1[0] - lsnum1[1]
    for j in ls:
        if j == '+':
            ans7 += lsnum1[2]
        else:
            ans7 -= lsnum1[2]
        for k in ls:
            if k == '+':
                ans7 += lsnum1[3]
            else:
                ans7 -= lsnum1[3]
            if ans7 == 7:
                ans = lsnum[0]+i+lsnum[1]+j+lsnum[2]+k+lsnum[3]+'=7'
                break
print(ans)
Problem p03635 (python)

Fixed submission:
n , m = map(int,input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
print((int(input())-1)*(int(input())-1))
Problem p03638 (python)

Fixed submission:
import numpy as np
H,W = map(int,input().split())
N = int(input())
lsa = list(map(int,input().split()))
ls2 = []
for i in range(N):
    ls2 += [i+1]*lsa[i]
arr = np.array(ls2)
arr = arr.reshape(H,W).tolist()
arr2 = []
for i in range(H):
    if i % 2 == 0:
        arr2.append(arr[i])
    else:
        arr[i].reverse()
        arr2.append(arr[i])
for i in range(H):
    arr2[i] = [str(j) for j in arr2[i]]
    print(' '.join(arr2[i]))

Buggy submission (verdict: Runtime Error):
import numpy as np
H,W = map(int,input().split())
N = int(input())
lsa = list(map(int,input().split()))
ls2 = []
for i in range(N):
    ls2 += [i+1]*lsa[i]
arr = np.array(ls2)
arr = arr.reshape(H,W).tolist()
arr2 = []
for i in range(H):
    if i % 2 == 0:
        arr2.append(arr[i])
    else:
        arr[i].reverse()
        arr2.append(arr[i])
for i in range(H):
    arr2[i] = [str(j) for j in arr2[i]]
    print(' '.join(arr2[i]))
Problem p03760 (python)

Fixed submission:
O = input()
E = input()
N = len(E)
ans = ''
for i in range(N):
    ans += O[i] + E[i]
if len(O)-len(E) == 1:
    ans += O[-1]
print(ans)

Buggy submission (verdict: Runtime Error):
O = input()
E = input()
N = len(O)
ans = ''
for i in range(N):
    ans += O[i] + E[i]
print(ans)
Problem p03828 (python)

Fixed submission:
import collections
N = int(input())
ls = [0]+[0]*N
couterls = collections.Counter(ls)
for i in range(1,N+1):
    for j in range(2,N+1):
        if i % j == 0:
            while i % j == 0:
                couterls[j] += 1
                i = i // j
        elif i == 1:
            break
        else:
            pass
ans = 1
couterls.pop(0)
for i in couterls.values():
    ans = (ans * (i+1) ) % (10**9+7)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = [0]+[0]*N
couterls = collections.Counter(ls)
for i in range(1,N+1):
    for j in range(2,N+1):
        if i % j == 0:
            while i % j == 0:
                couterls[j] += 1
                i = i // j
        elif i == 1:
            break
        else:
            pass
ans = 1
couterls.pop(0)
for i in couterls.values():
    ans = (ans * (i+1) ) % (10**9+7)
print(ans)
Problem p02657 (python)

Fixed submission:
n, m = map(int,input().split())
print(n*m)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())

count = 0

def sosu(n,z):
    for i in range(z, int(math.sqrt(n))+1):
        if n%i == 0:
            return i
            break
    return -1

if sosu(n,2) == -1 and n != 1:
    print(1)
    exit()

ans  = 0
z = 2

def hantei(n):
    i = sosu(n,2)
    s = 0
    if sosu(n,2) == -1:
        return True
    if sosu(n,2) > 0:
        s = n ** (1/i)
        if int(s) == math.floor(s):
            #print(n,s)
            return True
        else:
            return False

memo = []

while(n != 1) :
    ans = sosu(n,z)
    print(n,ans,z)
    if ans == -1:
        if memo.count(n) == 0 and hantei(n):
            count +=1
            break
        else:
            break

    if hantei(ans) :
        memo.append(ans)
        z = ans+1
        n = n//ans
        count += 1
    else:
        z = ans +1
    #print(count)



print(count)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())

count = 0

def sosu(n,z):
    for i in range(z, int(math.sqrt(n))+1):
        if n%i == 0:
            return i
            break
    return -1

if sosu(n,2) == -1 and n != 1:
    print(1)
    exit()

ans  = 0
z = 2

def hantei(n):
    i = sosu(n,2)
    s = 0
    if sosu(n,2) == -1:
        return True
    if sosu(n,2) > 0:
        s = n ** (1/i)
        if int(s) == math.floor(s):
            print(n,s)
            return True
        else:
            return False

memo = []

while(n != 1) :
    ans = sosu(n,z)
    print(n,ans,z)
    if ans == -1:
        if memo.count(n) == 0 and hantei(n):
            count +=1
            break
        else:
            break

    if hantei(ans) :
        memo.append(ans)
        z = ans+1
        n = n//ans
        count += 1
    else:
        z = ans +1
    #print(count)



print(count)
Problem p02576 (python)

Fixed submission:
N, X, T = map(int, input().split())
import math
number_of_times = math.ceil(N/X)
total_time = T * number_of_times
print(total_time)

Buggy submission (verdict: Runtime Error):
N, X, T = map(int, input())
import math
number_of_times = math.ceil(N/X)
total_time = T * number_of_times
print(number_of_times)
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()))
ans = 1

if 0 in a: print('0')
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            print(-1)
        break
    print(ans)
Problem p02687 (python)

Fixed submission:
s = input()
if s == 'ABC':
    print('ARC')
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
s = input()
if s = 'ABC':
    print('ARC')
else:
    print('ABC')