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

Fixed submission:
from collections import Counter
 
n, m = map(int, input().split())
A = list(map(int, input().split()))
 
B = [0] * (n + 1)
 
for i in range(n):
  B[i + 1] = B[i] + A[i] # BはAの累積和

li = [i % m for i in B] # それをMで割った余りがli

C = Counter(li) # 余りが同じものの個数が2つ以上ある際、その2つの組み合わせによって、割り切れる和の組み合わせ個数が求まる

ans = 0
for v in C.values():
  if v > 1:
    ans += v * (v - 1) // 2
 
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
 
n, m = map(int, input().split())
A = list(map(int, input().split()))
 
B = [0] * (n + 1)
 
for i in range(n):
  B[i + 1] = accr[i] + A[i] # BはAの累積和

li = [i % m for i in B] # それをMで割った余りがli

C = Counter(li) # 余りが同じものの個数が2つ以上ある際、その2つの組み合わせによって、割り切れる和の組み合わせ個数が求まる

ans = 0
for v in C.values():
  if v > 1:
    ans += v * (v - 1) // 2
 
print(ans)
Problem p03463 (python)

Fixed submission:
a=list(input().split(" "))
x=int(a[1])
y=int(a[2])
 
if abs(x-y)%2==0:
  print("Alice")
else:
  print("Borys")

Buggy submission (verdict: Runtime Error):
a=list(input())
x=int(a[1])
y=int(a[2])

if abs(x-y)%2==0:
  print("Alice")
else:
  print("Borys")
Problem p02714 (python)

Fixed submission:
N=int(input())
S=input()
s=0
s+=S.count('R')*S.count('G')*S.count('B')
for i in range(N):
  for j in range(i+1,N):
    k=2*j-i
    if k<N and S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      s-=1
print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
s=0
s+=S.count('R')*S.count('G')*S.count('B')
for i in range(N):
  for j in range(i+1,j):
    k=2*j-i
    if k<n and S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      s-=1
print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
s=0
s+=S.count('R')*S.count('G')*S.count('B')
for i in range(N):
  for j in range(i+1,j):
    k=2*j-1
    if k<n and S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      s-=1
print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
s=0
s+=S.count('R')*S.count('G')*S.count('B')
for i in range(N):
  for j in range(i+1,j):
    k=2*j-1
    if k<n and S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      s-=1
print(s)
Problem p02741 (python)

Fixed submission:
K=int(input())
if K==32:
  print(51)
elif K==24:
  print(15)
elif K==16:
  print(14)
elif K==8 or K==12 or K==18 or K==20 or K==27:
  print(5)
elif K==28 or K==30:
  print(4)
elif K==4 or K==6 or K==9 or K==10 or K==14 or K==21 or K==22 or K==25 or K==26:
  print(2)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
K=int(input())
if K=32:
  print(51)
elif K=24:
  print(15)
elif K=16:
  print(14)
elif K=8 or K=12 or K=18 or K=20 or K=27:
  print(5)
elif K=28 or K=30:
  print(4)
elif K=4 or K=6 or K=9 or K=10 or K=14 or K=21 or K=22 or K=25 or K=26:
  print(2)
Problem p02801 (python)

Fixed submission:
print(chr(ord(input())+1))

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

Fixed submission:
a,b = map(int,input().split())
AC = [0]*(a+1)
WA = [0]*(a+1)
ac = 0
wa = 0
wat = 0

for i in range(b):
  x,y = map(str,input().split())
  if y == "WA":
    WA[int(x)] += 1
  elif AC[int(x)] == 0 and y == "AC":
    wa += WA[int(x)]
    ac += 1
    AC[int(x)] = 1

print(ac,wa)

Buggy submission (verdict: Runtime Error):

N, M=map(int(input().split())
AC=[0]*(a+1)
WA=[0]*(a+1)
ac=0
wa=0
t=0
for i in range(M):
    x,y=map(str(input().split())
    if y=="WA":
        WA[int(x)]+=1   
    elif x=="AC" and AC[int(x)]==0:
        wa+=WA[int(x)]
        ac+=1     
        AC[int(x)]=1
print(ac, wa)

Buggy submission (verdict: Runtime Error):
N, M=map(int(input().split())
AC=[0]*(a+1)
WA=[0]*(a+1)
ac=0
wa=0
t=0
for i in range(M):
    x,y=map(str(input().split())
    if y=="WA":
        WA[int(x)]+=1   
    elif x=="AC" and AC[int(x)]==0:
        wa+=WA[int(x)]
        ac+=1     
        AC[int(x)]=1
print(ac, wa)

Buggy submission (verdict: Runtime Error):

N, M=list(map(int(input().split()))
AC=[0]*(a+1)
WA=[0]*(a+1)
ac=0
wa=0
t=0
for i in range(M):
    x,y=map(str(input().split())
    if y=="WA":
        WA[int(x)]+=1   
    elif x=="AC" and AC[int(x)]==0:
        wa+=WA[int(x)]
        ac+=1     
        AC[int(x)]=1
print(ac, wa)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M=list(map(int(input().split()))
AC=[0]*(a+1)
WA=[0]*(a+1)
ac=0
wa=0
t=0
for i in range(M):
    x,y=map(str(input().split())
    if y=="WA":
        WA[int(x)]+=1   
    elif x=="AC" and AC[int(x)]==0:
        wa+=WA[int(x)]
        ac+=1     
        AC[int(x)]=1
print(ac, wa)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M=list(map(int(input().split()))
AC=[0]*(a+1)
WA=[0]*(a+1)
ac=0
wa=0
t=0
for i in range(M):
    x,y=list(map(str(input().split()))
    if y=="WA":
        WA[int(x)]+=1   
    elif x=="AC" and AC[int(x)]==0:
        wa+=WA[int(x)]
        ac+=1     
        AC[int(x)]=1
print(ac, wa)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M=list(map(int(input().split()))
AC=[0]*(a+1)
WA=[0]*(a+1)
ac=0
wa=0
t=0
for i in range(M):
    x,y=list(map(str(input().split()))
    if y=="WA":
        WA[x]+=1   
    elif x=="AC" and AC[x]==0:
        wa+=WA[x]
        ac+=1     
        AC[x]=1
print(ac, wa)
Problem p02812 (python)

Fixed submission:
N=int(input())
S=input()
c=0
for i in range(N-2):
  if S[i:i+3]=="ABC":
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input
c=0
for i in range(0,N-2):
  if S[i:i+2]="ABC":
    c+=1
return c

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input
c=0
for i in range(0,N-2):
  if S[i;i+2]="ABC":
    c+=1
return c
Problem p02999 (python)

Fixed submission:
X,A=map(int,input().split())
if(X<A):
  print("0")
else:
  print("10")

Buggy submission (verdict: Runtime Error):
X,A=map(int,input().split)
if(X<A):
  print("0")
else:
  print("10")
Problem p03759 (python)

Fixed submission:
a,b,c=input().split()
d=[]
d.append(int(a))
d.append(int(b))
d.append(int(c))
if d[2]-d[1]==d[1]-d[0]:
	print('YES')
else:
	print('NO')

Buggy submission (verdict: Runtime Error):
a=[]
a=input().split()
a.sort()
if a[2]-a[1]==a[1]-a[0]:
	print('YES')
else:
	print('NO')

Buggy submission (verdict: Runtime Error):
a=[]
for i in range(3):
	a.append(int(input()))
a.sort()
if a[2]-a[1]==a[1]-a[0]:
	print('YES')
else:
	print('NO')

Buggy submission (verdict: Runtime Error):
a[]
for i in range(3):
	a.append(input())
a.sort()
if a[2]-a[1]==a[1]-a[0]:
	print('YES')
else:
	print('NO')

Buggy submission (verdict: Runtime Error):
a=[]
a.append(input())
a.sort()
if a[2]-a[1]==a[1]-a[0]:
	print('YES')
else:
	print('NO')

Buggy submission (verdict: Runtime Error):
a=[]
a.append(input())
a.sort()
if a[2]-a[1]==a[1]-a[0]:
	print('YES')
else:
	print('NO')

Buggy submission (verdict: Runtime Error):
a=[]
a.append(input())
a.sort()
if l[2]-l[1]==l[1]-l[0]:
	print('YES')
else:
	print('NO')

Buggy submission (verdict: Runtime Error):
l=map(int,raw_input().split())
l.sort()
if l[2]-l[1]==l[1]-l[0]:
	print('YES')
else:
	print('NO')
Problem p02727 (python)

Fixed submission:
X,Y,A,B,C = map(int,input().split())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))

R+=sorted(P)[-X:]
R+=sorted(Q)[-Y:]

a=-(X+Y)
print(sum(sorted(R)[a:]))

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C = map(int,input().split())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))

P_up = P[-X:]
Q_up = Q[-Y:]

P_up.append(Q_up)
P_up.extend(R)

P_up.sort()
a=-(X+Y)
print(sum(P_up[a:]))
Problem p02741 (python)

Fixed submission:
K = int(input())
a = [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]

print(a[K-1])

Buggy submission (verdict: Runtime Error):
K = int(input())
a = [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]

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

Fixed submission:
C = str(input())
Z='abcdefghijklmnopqrtuvwxyz'
alpha = list(Z)
l_in = [alpha[i+1] for i in range(len(alpha)-1) if C in alpha[i]]
print(l_in[0])

Buggy submission (verdict: Runtime Error):
N,K,M=map(int,input().split())
point = list(map(int,input().split()))
full = N*K
tar = M*N
all_p = sum(point)

if full- all_p >full-K:
    print(-1)
else:
    print(full-K-sum(point))
Problem p02830 (python)

Fixed submission:
N = int(input())
S,T=map(str, input().split())
f = ''
for i in range(N):
    f += S[i]
    f += T[i]
print(f)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
T = str(input())
f = ''
for i in range(N):
    f += S[i]
    f += T[i]
print(f)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
T = str(input())
f = ''
for i in range(N):
    f += S[i]
    f += T[i]
print(f)

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

f = ''
for i in range(N):
    f += S[i]
    f += T[i]
print(f)
Problem p03385 (python)

Fixed submission:
N = str(input())
print('Yes') if ('a' in N) and ('b' in N) and ('c' in N) else print('No')

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
result = list(range(A,B+1)[:K]) + list(range(A,B+1)[-K:])
print(list(set(result)))
Problem p03399 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
print(min(A,B) + min(C,D))

Buggy submission (verdict: Runtime Error):
A,B,C,D=list(map(int,input().split()))
print(min(A,B) + min(C,D))

Buggy submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())
print(min(A,B) + min(C,D))
Problem p03407 (python)

Fixed submission:
A,B,C=map(int,input().split())
print('Yes') if A+B >= C else print('No')

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

print('Yes') if A+B >= C else print('No')
Problem p03416 (python)

Fixed submission:
A,B =map(int,input().split())
result = []
for i in range(A,B+1):
    if (str(i)[0] == str(i)[4]) & (str(i)[1] == str(i)[3]):
        result.append(i)
print(len(result))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
result = []
for i in range(A,B+1):
    if (str(i)[0] == str(i)[4]) & (str(i)[1] == str(i)[3]):
        result.append(i)
print(len(result))
Problem p03434 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
Alice = sum(A[::2])
Bob = sum(A[1::2])
print(Alice-Bob)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]

Alice = []
Bob = []

for i in range(N):
    if len(A) != 0:
        Alice.append(max(A))
        A.remove(max(A))
    else:
        break
    if len(A) != 0:
        Bob.append(max(A))
        A.remove(max(A))
    else:
        break
print(sum(Alice) - sum(Bob))
Problem p03447 (python)

Fixed submission:

X = int(input())
A = int(input())
B = int(input())
print((X - A)% B)

Buggy submission (verdict: Runtime Error):
X,A,B = map(int,input().split(' '))
print((X - A) - int((X-A) /100) * B)

Buggy submission (verdict: Runtime Error):
X,A,B = map(int,input().split(' '))
print(X - (A + B))
Problem p03448 (python)

Fixed submission:
import numpy as np
A = int(input())
B = int(input())
C = int(input())
X = int(input())
memo = np.zeros(3).reshape(1,3)

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if X == 500*i + 100*j + 50*k :
                result = np.array([i,j,k])
                memo = np.vstack([memo,result])

print(len(memo[1:]))

Buggy submission (verdict: Runtime Error):

A = int(input())
B = int(input())
C = int(input())
X = int(input())
memo = np.zeros(3).reshape(1,3)

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if X == 500*i + 100*j + 50*k :
                result = np.array([i,j,k])
                memo = np.vstack([memo,result])

print(len(memo[1:]))
Problem p02854 (python)

Fixed submission:
N = int(input())

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

sum_of_an = sum(An)

if sum_of_an % 2 == 0:
    half_of_an = sum_of_an / 2
    sum_left_len = 0
    for l in An:
        sum_left_len += l
        if sum_left_len == half_of_an:
            print(0)
            exit(0)
        elif sum_left_len > half_of_an:
            break
min_yen = None
left_len = 0
for (i, l) in zip(range(0, N), An):
    if i == N - 1:
        break

    left_len += l
    if min_yen is None:
        min_yen = abs(sum_of_an - left_len * 2)
    else:
        min_yen = min(min_yen, abs(sum_of_an - left_len * 2))

print(min_yen)

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

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

sum_of_an = sum(An)

if sum_of_an % 2 == 0:
    half_of_an = sum_of_an / 2
    sum_left_len = 0
    for l in An:
        sum_left_len += l
        if sum_left_len == half_of_an:
            print(0)
            exit(0)
        elif sum_left_len > half_of_an:
            break
min_yen = None
left_len = 0
for (i, l) in zip(range(0, N), An):
    if i == N:
        break

    left_len += l
    if min_yen is None:
        min_yen = abs(sum_of_an - left_len)
    else:
        min_yen = min(min_yen, abs(sum_of_an, left_len))

print(min_yen)

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

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

sum_of_an = sum(An)

if sum_of_an % 2 == 0:
    half_of_an = sum_of_an / 2
    sum_left_len = 0
    for l in An:
        sum_left_len += l
        if sum_left_len == half_of_an:
            print(0)
            exit(0)
        elif sum_left_len > half_of_an:
            break
min_yen = None
left_len = 0
for (i, l) in zip(range(0, N - 1), An):
    left_len += l
    if min_yen is None:
        min_yen = abs(sum_of_an - left_len)
    else:
        min_yen = min(min_yen, abs(sum_of_an, left_len))

print(min_yen)
Problem p03338 (python)

Fixed submission:
# -*- coding: utf-8 -*-

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

ans=0
for i in range(1,n):
    a=set(s[:i])
    b=set(s[i:])
    c=a&b
    if len(c)>ans:
        ans=len(c)

print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

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

async=0
for i in range(1,n):
    a=set(s[:i])
    b=set(s[i:])
    c=a&b
    if len(c)>ans:
        ans=len(c)

print(ans)
Problem p03695 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n=int(input())
a=list(map(int, input().split()))
a.sort()
d=[0 for _ in range(8)]

flg=False
minim=-1
for i in range(n):
    if a[i]<400:
        d[0]=1
    elif a[i]<800:
        d[1]=1
    elif a[i]<1200:
        d[2]=1
    elif a[i]<1600:
        d[3]=1
    elif a[i]<2000:
        d[4]=1
    elif a[i]<2400:
        d[5]=1
    elif a[i]<2800:
        d[6]=1
    elif a[i]<3200:
        d[7]=1
    else:
        if flg==False:
            minim=sum(d)
            flg=True
        d[0]+=1

if minim==-1:
    minim=sum(d)
elif minim==0:
    minim=1
print(minim,end=' ')
print(sum(d))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n=int(input())
a=list(map(int, input().split()))
a.sort()
d=[0 for _ in range(8)]

flg=False
minim=-1
for i in range(n):
    if a[i]<400:
        d[0]=1
    elif a[i]<800:
        d[1]=1
    elif a[i]<1200:
        d[2]=1
    elif a[i]<1600:
        d[3]=1
    elif a[i]<2000:
        d[4]=1
    elif a[i]<2400:
        d[5]=1
    elif a[i]<2800:
        d[6]=1
    elif a[i]<3200:
        d[7]=1
    else:
        if flg==False:
            minim=sum(d)
            flg=True
        for j in range(n):
            if d[j]==0:
                d[j]=1
                break

if minim==-1:
    minim=sum(d)
print(minim,end=' ')
print(sum(d))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n=int(input())
a=list(map(int, input().split()))
a.sort()
d=[0 for _ in range(8)]

flg=False
minim=-1
for i in range(n):
    if a[i]<400:
        d[0]=1
    elif a[i]<800:
        d[1]=1
    elif a[i]<1200:
        d[2]=1
    elif a[i]<1600:
        d[3]=1
    elif a[i]<2000:
        d[4]=1
    elif a[i]<2400:
        d[5]=1
    elif a[i]<2800:
        d[6]=1
    elif a[i]<3200:
        d[7]=1
    else:
        if flg==False:
            minim=sum(d)
            flg=True
        for j in range(n):
            if d[j]==0:
                d[j]=1
                break

if minim==-1:
    minim=sum(d)
print(minim,sum(d))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n=int(input())
a=list(map(int, input().split()))
a.sort()
d=[0 for _ in range(8)]

flg=False
minim=-1
for i in range(n):
    if a[i]<400:
        d[0]=1
    elif a[i]<800:
        d[1]=1
    elif a[i]<1200:
        d[2]=1
    elif a[i]<1600:
        d[3]=1
    elif a[i]<2000:
        d[4]=1
    elif a[i]<2400:
        d[5]=1
    elif a[i]<2800:
        d[6]=1
    elif a[i]<3200:
        d[7]=1
    else:
        if flg==False:
            minim=sum(d)
            flg=True
        for j in range(n):
            if d[j]==0:
                d[j]=1
                break

if minim==-1:
    minim=sum(d)
print(minim, " ", sum(d))
Problem p03730 (python)

Fixed submission:
# -*- coding: utf-8 -*-

import fractions

a,b,c=map(int, input().split())

d=fractions.gcd(a,b)

if c%d==0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

a,b,c=map(int, input().split())

d=math.gcd(a,b)

if c%d==0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

a,b,c=map(int, input().split())

d=math.gcd(a,b)

if c%d==0:
    print("YES")
else:
    print("NO")
Problem p03071 (python)

Fixed submission:
a,b=[int(i) for i in input().split()]
print(max([2*a-1,a+b,2*b-1]))

Buggy submission (verdict: Runtime Error):
a,b=[int(i) for i in input().split()]
print(min([2*a-1,a+b,2*b-1])

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

print(min[2*a-1,a+b,2*b-1])
Problem p03079 (python)

Fixed submission:
temp = input()
temp_spl = temp.split()
a = int(temp_spl[0])
b = int(temp_spl[1])
c = int(temp_spl[2])

if a == b and b == c and b >=1 and b <= 100:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
temp = input()
temp_spl = temp.split()
N = int(temp_spl[0])
Q = int(temp_spl[1])

temp = input()
s = temp
golem_place = list(range(N))

# 呪文の数だけループする
for i in range(Q):
    temp = input()
    temp_spl = temp.split()
    t = temp_spl[0]
    d = temp_spl[1]
    if d == "L":
        adder = -1
    else:
        adder = 1
    # golemの移動
    for j in range(N):
        if golem_place[j] != 99999999:
            if s[golem_place[j]] == t:
                golem_place[j] = golem_place[j] + adder

    # ゴーレムを排除
    for j in range(N):
        if golem_place[j] < 0 or golem_place[j] >= N:
            golem_place[j] = 99999999
    #print(golem_place)

alive_count = 0
for i in range(N):
    if golem_place[i] < 99999999:
        alive_count = alive_count + 1
print(alive_count)

Buggy submission (verdict: Runtime Error):
temp = input()
temp_spl = temp.split()
a = int(temp_spl[0])
b = int(temp_spl[1])
c = int(temp_spl[2])

if a == b and b == c and b >=1 and b <= 100:
    print("Yes")
else:
    pritn("No")
Problem p02747 (python)

Fixed submission:
S = input().strip()
target = S
if target == 'hi':
    print('Yes')
elif target == 'hihi':
    print('Yes')
elif target == 'hihihi':
    print('Yes')    
elif target == 'hihihihi':
    print('Yes')
elif target == 'hihihihihi':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input().strip()
s = str.lower(S)
target = 'hi'
if target = 'hi':
    print('Yes')
elif target = 'hihi':
    print('Yes')
elif target = 'hihihi':
    print('Yes')    
elif target = 'hihihihi':
    print('Yes')
elif target = 'hihihihihi':
    print('Yes')
else
    print('No')
Problem p03050 (python)

Fixed submission:
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

divisors = make_divisors(N)

count = 0
for divisor in divisors:
    m = divisor-1
    if m and (N//m == N%m):
        count += m
print(count)

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

sum = 0
for i in range (1,N+1):
    if N//i == N%i:
        sum += i
array.append(sum)
print(sum)
Problem p03085 (python)

Fixed submission:
A = input()
if A == 'A':
    print ('T')
elif A == 'T':
    print ('A')
elif A == 'G':
    print ('C')
else:
    print('G')

Buggy submission (verdict: Runtime Error):
A = input()
if A = 'A':
    print ('T')
elif A = 'T':
    print ('A')
elif A = 'G':
    print ('C')
else:
    print('G')
Problem p03086 (python)

Fixed submission:
S = input()

atgc = ['A','T','G','C']

max_count = 0
count = 0
for i in range(len(S)):
    if S[i] in atgc:
        count+=1
    else:
        max_count = max(max_count,count)
        count = 0
max_count = max(max_count,count)
print(max_count)

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

max_count = 0
count = 0
for i in range(len(S)):
    if S[i] in atgc:
        count+=1
    else:
        max_count = max(max_count,count)
        count = 0
print(max_count)
Problem p03087 (python)

Fixed submission:
N, Q = map(int,input().split())
S = input()

atgc_list= []

flag = 0
memo =0

for i in range (len(S)):
    if S[i]=='A':
        flag = 1
    elif flag == 1 and S[i] == 'C':
        memo+=1
        flag = 0
    elif S[i] in ['T','G','C']:
        flag = 0
    atgc_list.append(memo)
        

for j in range (Q):
    l, r = map(int,input().split())
    low = atgc_list[l-1]
    high = atgc_list[r-1]
    print(high - low)

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

atgc_list= []

flag = 0
memo =0

for i in range (len(S)):
    if S[i]=='A':
        flag = 1
    elif flag == 1 and S[i] == 'C':
        memo+=1
    elif S[i] in ['T','G','C']:
        flag = 0
    atgc_list.append(memo)
        
atgc_list_np = np.array(atgc_list)

for j in range (Q):
    l, r = map(int,input().split())
    low = atgc_list[l-1]
    high = atgc_list[r-1]
    print(high - low)

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

atgc_list= []

flag = 0
memo =0

for i in range (len(S)):
    if S[i]=='A':
        flag = 1
    if flag == 1 and S[i] == 'C':
        memo+=1
    if S[i] in ['T','G']:
        flag = 0
    atgc_list.append(memo)
        
atgc_list_np = np.array(atgc_list)

for j in range (Q):
    l, r = map(int,input().split())
    low = atgc_list[l-1]
    high = atgc_list[r-1]
    print(high - low)
Problem p03102 (python)

Fixed submission:
import numpy as np
 
N, M, C = map(int,input().split())
 
B = list(map(int,input().split()))
 
count = 0
for i in range (N):
    A = list(map(int,input().split()))
    if np.sum(np.array(A)*np.array(B)) + C> 0:
        count += 1
print(count)

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

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

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

count = 0
for i in range (N):
    A = list(map(int,input().split()))
    if np.array(A)*np.array(B) > 0:
        count += 1
print(count)
Problem p03161 (python)

Fixed submission:
import numpy as np
N, K= map(int,input().split())
h = list(map(int,input().split()))
 
dp = [0] * N
h = np.array(h)
 
dp = np.array([0]*N, dtype=np.int64)
 
for i in range (1, N):
    x = max(0, i - K)
    dp[i] = np.min(dp[x:i] + np.abs(h[i]-h[x:i]))
print(dp[N-1])

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

dp = [0] * N
h = np.array(h)

dp = np.array([0]*N, dtype=np.int64)

for i in range (1, N):
    x = max(0, i - K)
    dp[i] = np.min(dp[x:i] + np.abs(h[i]-h[x:i]))
print(dp[N-1])
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, M =map(int,input().split())
ans=1
for i in range (1,M//N):
    if M%i==0:
        if M//i>=N:
            ans=i
print(ans)