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

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
def odd(n) : return (n%2==1)
lst = list(filter(odd,arr[0:n:2]))
print(len(lst))

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
arr = arr[::2]
def odd(n) : return (n%2==1)
lst = filter(odd,arr)
print(len(lst))

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
arr = arr[::2]
count = 0
for i in arr:
  if i%2==1: count+= 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
def mod(i): return i%2==1
lst = list(filter(mod==True,arr))
print(len(lst))

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
def mod(i): return i%2==1
lst = list(filter(lambda x: mod(x),arr[::2]))
print(len(lst))

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
def mod(i): return i%2==1
lst = list(filter(mod,arr[::2]))
print(len(lst))

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
lst = filter(i%2==1,arr[::2])
print(len(lst))

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
for i in range(0,n,2):
  if arr[i]%2 == 1 : count+=1
print(count)
Problem p02602 (python)

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

for i in range(n-k):
    if a[i]<a[i+k]:
        print("Yes")
    else:
        print("No")

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

for i in range(n-k):
    if a[i]<s[i+1]:
        print("Yes")
    else:
        print("No")
Problem p02658 (python)

Fixed submission:
import sys
N = int(input())
An = []
mul = 1

An = list(map(int,input().split()))
if An.count(0) > 0:
    print("0")
    sys.exit()

for i in An:
    mul *= i
    if mul > 10**18:
        print("-1")
        sys.exit()

if mul <= 10**18:
    print(mul)

Buggy submission (verdict: Runtime Error):
A,B = map(float,input().split())
B = B*100
print(int(A*B/100))
Problem p02742 (python)

Fixed submission:
#6
import sys
H,W = map(int,input().split())
k = H*W

if H ==1 or W == 1:
    print(1)
    sys.exit()

if k%2 == 0:
    print(int(k/2))
else:
    print(int(k/2)+1)

Buggy submission (verdict: Runtime Error):
#6
H,W = map(int,input().split())
k = H*W
if k%2 == 0:
    print(int(k/2)
else:
    print(int(k/2)+1)
Problem p02760 (python)

Fixed submission:
#7
A = [list(map(int,input().split())) for i in range(3)]

N = int(input())

B = [int(input()) for i in range(N)]

C = [[0,0,0],[0,0,0],[0,0,0]]
Ans = "No"

for i in range(3):
    for j in range(3):
        if A[i][j] in B:         #AijはリストBに含まれるかどうか
            C[i][j] = 1

for i in range(3):
    if C[i][0]+C[i][1]+C[i][2] == 3:
        Ans ="Yes"

for i in range(3):
    if C[0][i]+C[1][i]+C[2][i] == 3:
        Ans ="Yes"
        
if C[0][0]+C[1][1]+C[2][2] == 3 or C[0][2]+C[1][1]+C[2][0] == 3:
    Ans = "Yes"
    
print(Ans)

Buggy submission (verdict: Runtime Error):
#7
A = [list(map(int,input().split())) for i in range(3)]

N = int(input())

B = [int(input()) for i in range(N)]

C = [[0,0,0],[0,0,0],[0,0,0]]
Ans = "No"

for i in range(3):
    for j in range(3):
        if A[i][j] in B:         #AijはリストBに含まれるかどうか
            C[i][j] = 1

for i in range(3):
    if C[i][1]+C[i][2]+C[i][3] == 3:
        Ans ="Yes"

for i in range(3):
    if C[1][i]+C[2][i]+C[3][i] == 3:
        Ans ="Yes"
        
if C[1][1]+C[2][2]+C[3][2] == 3 or C[1][3]+C[2][2]+C[3][1] == 3:
    Ans = "Yes"
    
print(Ans)
Problem p02842 (python)

Fixed submission:
#4
import sys
N = int(input())
x,y,k = 0,0,0

if N == 1:
    print(1)
    sys.exit()
elif N <= 12:
    print(N)
    sys.exit()
x = int(0.8*N)

for i in range(x,N):
    k = str(i*108)
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")

Buggy submission (verdict: Runtime Error):
#4
N = int(input())
x,y,k = 0,0,0

x = int(0.8*N)

for i in range(x,N):
    k = str(i*108)
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")

Buggy submission (verdict: Runtime Error):
#4
N = int(input())
x,y,k = 0,0,0

x = int(0.8*N)

for i in range(x,N):
    k = str(int(i*108))
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")

Buggy submission (verdict: Runtime Error):
#4
N = int(input())
x,y,k = 0,0,0

x = int(0.8*N)

for i in range(x,N):
    k = str(int(i*108))
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")

Buggy submission (verdict: Runtime Error):
#4
N = int(input())
x,y,k = 0,0,0

x = int(0.8*N)

for i in range(x,N):
    k = int(i*108)
    if k[0:-2] == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")

Buggy submission (verdict: Runtime Error):
#4
N = int(input())
x,y,k = 0,0

x = int(0.8*N)

for i in range(x,N):
    k = int(i*108)
    if k[0:-2] == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")
Problem p03037 (python)

Fixed submission:
#36
N,M = map(int,input().split())
li = []
ri = []
num = 0


for i in range(M):
    L,R = map(int,input().split())
    li.append(L)
    ri.append(R)
L = max(li)
R = min(ri)
num = R-L+1
if num <0:
    num= 0
    
print(num)

Buggy submission (verdict: Runtime Error):
#36
N,M = map(int,input().split())
li = []
ri = []
x = []
y = []
L,R = map(int,input().split())
for i in range(L,R+1):
    x.append(i)
for i in range(M-1):
    L,R = map(int,input().split())
    if L < x[0]:
        L = x[0]
    if R > x[-1]:
        R = x[-1]
    for j in range(L,R+1):
        y.append(j)
    x = y
    y = []
          
cou = len(x)
print(cou)
Problem p03076 (python)

Fixed submission:
#38
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
last = 9
time = 0
cou = 0
check = 0
#l = [[A,"A"],[B,"B"],[C,"C"],[D,"D"],[E,"E"]]
l = [A,B,C,D,E]
for i in l:
    if i%10 !=0 :
        if last%10 >= i%10:
            last = i
            check +=1
if check !=0:
    l.remove(last)
    l.append(last)
for i in range(5):
    time += l[i]
    if i == 4:
        break
    while time%10 != 0:
        time += 1
        
    
print(time)

Buggy submission (verdict: Runtime Error):
#38
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
last = 9
time = 0
cou = 0
#l = [[A,"A"],[B,"B"],[C,"C"],[D,"D"],[E,"E"]]
l = [A,B,C,D,E]
for i in l:
    if i%10 !=0 :
        if last%10 >= i%10:
            last = i

l.remove(last)
l.append(last)
for i in range(5):
    time += l[i]
    if i == 4:
        break
    while time%10 != 0:
        time += 1
        
    
print(time)

Buggy submission (verdict: Runtime Error):
#38
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
last = 9
time = 0
cou = 0
#l = [[A,"A"],[B,"B"],[C,"C"],[D,"D"],[E,"E"]]
l = [A,B,C,D,E]
for i in l:
    if i%10 !=0 :
        if last%10 > i%10:
            last = i

l.remove(last)
l.append(last)
for i in range(5):
    time += l[i]
    if i == 4:
        break
    while time%10 != 0:
        time += 1
        
    
print(time)

Buggy submission (verdict: Runtime Error):
#38
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
last = 9
time = 0
cou = 0
#l = [[A,"A"],[B,"B"],[C,"C"],[D,"D"],[E,"E"]]
l = [A,B,C,D,E]
for i in l:
    if i%10 !=0 :
        if last%10 > i%10:
            last = i

l.remove(last)
l.append(last)
for i in range(5):
    time += l[i]
    if i == 4:
        break
    while time%10 != 0:
        time += 1
        
    
print(time)
Problem p03200 (python)

Fixed submission:
s=input()

ans=0
b_cnt=0
for i in range(len(s)):
  if s[i]=='B':
    b_cnt+=1
  else:
    ans+=b_cnt

print(ans)

Buggy submission (verdict: Runtime Error):
#2
s = list(input())
l = len(s)
cnt = 0

i = 0
for i in range(l)
    for j in range(l-1):
        if s[j] =="B" and s[j+1] == "W":
            cnt += 1
            s[j],s[j+1] = s[j+1],s[j]
            break
        break
print(cnt)
Problem p03611 (python)

Fixed submission:
#10
n = int(input())
a = list(map(int,input().split()))
cnt = [0 for i in range(10**5+2)]

for i in a:
    cnt[i] += 1
    cnt[i+1] += 1
    cnt[i+2] += 1
    
print(max(cnt))

Buggy submission (verdict: Runtime Error):
#10
n = int(input())
a = list(map(int,input().split()))
cnt = [0 for i in range(10**5)]

for i in a:
    cnt[i] += 1
    cnt[i+1] += 1
    cnt[i+2] += 1
    
print(max(cnt))
Problem p03699 (python)

Fixed submission:
#16
n = int(input())
s = [int(input()) for i in range(n)]

Max = sum(s)
s.sort()

if Max%10 ==0:
    for i in range(n):
        if s[i]%10 != 0:
            Max -= s[i]
        if Max%10 !=0:
            break
if Max%10 == 0:
    Max = 0
    
print(Max)

Buggy submission (verdict: Runtime Error):
#16
n = int(input())
s = [int(input()) for i in range(n)]

Max = sum(s)
s = list(set(s))

if Max%10 ==0:
    for i in range(n):
        Max -= s[i]
        if Max%10 !=0:
            break
    
    
print(Max)
Problem p03712 (python)

Fixed submission:
#49 ボツ
H,W = map(int,input().split())
a = []
for i in range(H):
    a.append(input())


for i in range(W+2):
    print("#",end = "")
print("")
for i in a:
    print("#",i,"#",sep = "")
for i in range(W+2):
    print("#",end = "")

Buggy submission (verdict: Runtime Error):
#49
H,W = map(int,input().split())
a = []
for i in range(H):
    a.append(input())


for i in range(W+2):
    print("#",end = "")
print("")
for i in a:
    print("#",l,"#",sep = "")
for i in range(W+2):
    print("#",end = "")
Problem p04030 (python)

Fixed submission:
S = input()
cha = list(S)
plist = []

for i in cha: 
    if i == "B":
        if plist != []:
            del plist[-1]
    else:
        plist.append(i)
            
plist = "".join(plist)

print(plist)

Buggy submission (verdict: Runtime Error):
S = input()
cha = list(S)
plist = []

for i in cha:
    if i == "B":
        del plist[-1]
    else:
        plist.append(i)

plist = "".join(plist)

print(plist)
Problem p04031 (python)

Fixed submission:
N = int(input())
an = list(map(int,input().split()))
ave  = round((sum(an)/N),0)
ans = 0

for i in an:
    ans += (i-ave)**2

print(int(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
an = list(map(int,input().split()))
ave  = round((sum(an)/N),0)
ans = 0

for i in an:
    ans += (i-ave)**2

print(inst(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
an = list(map(int,input().split()))
ave  = round((sum(an)/N),0)
print(ave)
ans = 0

for i in an:
    ans += (i-ave)**2

print(inst(ans))
Problem p02608 (python)

Fixed submission:
N=int(input())
ans = [0]*10000000
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            ans[i**2+j**2+k**2+i*j+j*k+i*k] += 1
for i in range(1,N+1):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
N=int(input())
ans = [0]*N
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            ans[i**2+j**2+k**2+i*j+j*k+i*k] += 1
for i in range(N):
    print(ans[i])

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


ans = 0
for i in range(1,int(n**0.5)):
    for j in range(i,int(n**0.5)):
        for k in range(j,int(n**0.5)):
            if i**2+j**2+k**2+i*j+j*k+k*i < n:
                if i == j and j == k:
                    ans += 1
                else:
                    ans += 3
                print(i,j,k,n)

    print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
for n in range(1,N+1):
    ans = 0
    for i in range(1,int((n**0.5)):
        for j in range(i,int((n**0.5)):
            for k in range(j,int((n**0.5)):
                if i**2+j**2+k**2+i*j+j*k+k*i==n:
                    if i == j and j == k:
                        ans += 1
                    else:
                        ans += 3

    print(ans)
Problem p02612 (python)

Fixed submission:
N = int(input())

N = N - 1000
for j in range (10):
    if N - (1000*j) <= 0 :
        print(abs(N-(1000*j)))
        break

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
list = list(map(int,input().split()))
list.sort(reverse=True)
seki = 1
seki1 = 1
seki2 = 1
if list[0] <= 0 and K % 2 != 0:
    for i in range(K):
        seki *= list[i]
elif N == K:
    for i in range(K):
        seki *= list[i]
else:
    for i in range(K):
        seki1 *= list[i]
    list.sort()
    for i in range(K):
        seki2 *= list[i]
    if (seki2 >= seki1) and (seki2 >= 0):
        seki = seki2
    elif (seki2 >= seki1) and (seki2 < 0):
        while seki2 < 0:
            i = 0
            seki2 = seki2 / list[i] * list[K+1+i]
            i += 1
        seki = seki2
    elif (seki1 > seki2) and (seki1 >= 0):
        seki = seki1
    else:
        list.sort(reverse=True)
        while seki1 < 0:
            i=0
            seki1 = seki1 / list[i] * list[K+1+i]
            i += 1
        seki = seki1

print(seki % ((10**9)+7))
Problem p02630 (python)

Fixed submission:
N=int(input())
A = list(map(int,input().split()))
Q=int(input())
B = [0]*Q
C = [0]*Q
for i in range(Q):
    B[i],C[i]=map(int,input().split())
#print(B,C)
#print(A)
#a = 0
#for i in range(N):
    #a += A[i]
#print(a)
ls = [0]*100000
for i in A:
    ls[i-1] += 1
#print(ls)
sumA = sum(A)
#print("sumA",sumA)
for j in range(Q):
    #print(B[j]-1)
    #print(ls)
    sumA += (C[j]-B[j])*ls[B[j]-1]
    #print("j","C[j]","B[j]","ls[B[j]]",j,C[j],B[j],ls[B[j]-1])
    ls[C[j]-1] += ls[B[j]-1]
    ls[B[j]-1] = 0
    print(sumA)

Buggy submission (verdict: Runtime Error):
N=int(input())
A = list(map(int,input().split()))
Q=int(input())
B = [0]*Q
C = [0]*Q
for i in range(Q):
    B[i],C[i]=map(int,input().split())
#print(B,C)
#print(A)
#a = 0
#for i in range(N):
    #a += A[i]
#print(a)
ls = []
for i in range(1,10**5):#10**5):
    ls.append(A.count(i))
#print(ls)
sumA = sum(A)
#print("sumA",sumA)
for j in range(Q):
    #print(B[j]-1)
    #print(ls)
    sumA += (C[j]-B[j])*ls[B[j]-1]
    #print("j","C[j]","B[j]","ls[B[j]]",j,C[j],B[j],ls[B[j]-1])
    ls[C[j]-1] += ls[B[j]-1]
    ls[B[j]-1] = 0
    print(sumA)

Buggy submission (verdict: Runtime Error):
N=int(input())
A = list(map(int,input().split()))
Q=int(input())
B = [0]*Q
C = [0]*Q
for i in range(Q):
    B[i],C[i]=map(int,input().split())
#print(B,C)
#print(A)
#a = 0
#for i in range(N):
    #a += A[i]
#print(a)
ls = []
for i in range(1,5):#10**5):
    ls.append(A.count(i))
#print(ls)
sumA = sum(A)
#print("sumA",sumA)
for j in range(Q):
    #print(B[j]-1)
    #print(ls)
    sumA += (C[j]-B[j])*ls[B[j]-1]
    #print("j","C[j]","B[j]","ls[B[j]]",j,C[j],B[j],ls[B[j]-1])
    ls[C[j]-1] += ls[B[j]-1]
    ls[B[j]-1] = 0
    print(sumA)
Problem p02658 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
ans = 1
flg = True
for i in range(N):
    ans *= A[i]
    if A[-1] != 0:
        if ans > 10**18:
            flg = False
            break
    if A[-1] == 0:
        ans = 0
        break
if flg == False:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
31
4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
ans = 1
for i in range(N):
    ans *= A[i]
    if ans >> 10**18:
        flg = False
        break
if flg == False:
    print(-1)
else:
    print(ans)
Problem p02677 (python)

Fixed submission:
import math
A,B,H,M = map(int,input().split())
dega = (60*H+M)*(360/(60*12))
degb = M*(360/60)
a = [A*math.cos(math.radians(dega)),A*math.sin(math.radians(dega))]
b = [B*math.cos(math.radians(degb)),B*math.sin(math.radians(degb))]
dir = ((a[0]-b[0])**2 + (a[1]-b[1])**2)**0.5
print(dir)

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())

a=[A*math.cos(math.radians(30*H+0.5*M),A*math.sin(math.radians(30*H+0.5*M))]
b=[B*math.cos(math.radians(M*60)),B*math.sin(math.radians(M*60))]
#print(a,b)
dir = ((a[0]-b[0])**2 + (a[1]-b[1])**2)**0.5
print(dir)
Problem p02694 (python)

Fixed submission:
#import math
x=int(input())
mon = 100
cnt = 0
while mon < x:
    mon += mon//100
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import math
x=int(input())
mon = 100
cnt = 0
while mon < X:
    mon = math.floor(mon*1.01)
    cnt += 1
print(cnt)
Problem p02760 (python)

Fixed submission:
ls=[]
for i in range(3):
    ls1=list(map(int,input().split()))
    ls.append(list(ls1))
    ls1.clear()
#print(ls)
N=int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for l in range(3):
            if ls[l][j] == b:
                ls[l][j] = -1
flg = False
for i in range(3):
    if ls[i][0] == ls[i][1] == ls[i][2] == -1:
        print("Yes")
        flg = True
        break
    elif ls[0][i] == ls[1][i] == ls[2][i] == -1:
        print("Yes")
        flg = True
        break
    elif ls[0][0] == ls[1][1] == ls[2][2] == -1:
        print("Yes")
        flg = True
        break
    elif ls[0][2] == ls[1][1] == ls[2][0] == -1:
        print("Yes")
        flg = True
        break
if flg == False:
    print("No")

Buggy submission (verdict: Runtime Error):
ls=[]
for i in range(3):
    ls1=list(map(int,input().split()))
    ls.append(list(ls1))
    ls1.clear()
print(ls)
N=int(input())
for i in range(N):
    b = int(input())
    for j in range(3):
        for l in range(3):
        if ls[l][j] == b:
            ls[l][j] = -1
for i in range(3):
    if ls[i][0] == ls[i][1] == ls[i][2] == -1:
        print("Yes")
        break
    elif ls[0][i] == ls[1][i] == ls[2][i] == -1:
        print("Yes")
        break
    elif ls[0][0] == ls[1][1] == ls[2][2] == -1:
        print("Yes")
        break
    elif ls[0][2] == ls[1][1] == ls[2][0] == -1:
        print("Yes")
        break
    print("No")
Problem p02767 (python)

Fixed submission:
N = int(input())
X = list(map(int,input().split()))
#ans = 10000
ls = []
for i in range(1,100):
    sum = 0
    for j in range(N):
        sum += (X[j]-i)**2
    ls.append(sum)
    #print(ls)
    #ans = min(ans,sum)
print(min(ls))

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int,input().split()))
ans = X **2
for i in range(1,100):
    sum = 0
    for j in range(N):
        sum += (X[j]-i)**2
    ans = min(ans,sum)
print(ans)
Problem p02802 (python)

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

AC = [0]*N
WA = [0]*N
AC_cnt = 0
WA_cnt = 0

p = [0]*M
S = [0]*M

for i in range(M):
    p[i],S[i] = map(str, input().split())

for i in range(M):
    q_num = int(p[i])
    if AC[q_num-1] == 0:
        if S[i] == "AC":
            AC[q_num-1] = 1
        else:
            WA[q_num-1] += 1

for i in range(N):
    if AC[i] == 1:
        WA_cnt += WA[i]
        AC_cnt += 1

print(AC_cnt,WA_cnt)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
p = [0]*M
S = [0]*M
ans_AC = [0]*N
ans_WA = [0]*N
for i in range(M):
    p[i],S[i] = map(str,input().split())


for i in range(M):
    pi = int(p[i])
    if S[i] == "AC":
        if ans_AC[pi] != 1:
            ans_AC[pi] = 1
    else:
        if ans_AC[pi] != 1:
            ans_WA[pi] += 1
print(sum(ans_AC),sum(ans_WA))
Problem p03031 (python)

Fixed submission:
N,M=map(int,input().split())
ls=[]
cnt,cnt2,ans=0,0,0
for i in range(M):
    ls1=list(map(int,input().split()))
    ls.append(list(ls1))
    ls1.clear()
lsp = list(map(int,input().split()))
#print(ls)
#print(lsp)
for i in range(2**N):
    flg = True
    for j in range(M):
        cnt = 0
        for k in range(1,len(ls[j])):
            if i >> ls[j][k]-1 & 1:
                cnt += 1
        if cnt%2 != lsp[j]:
            flg = False
    if flg:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input())
K = []
S = []
for i in range(M):
    list = input().split()
    K.append(int(list[0]))
    S.append(map(int,list[1::]))
p = list(map(int,input().split()))
anss = 0
for i in range(2**n):
    for j in range(M):
        ans = 0
        for k in range(N):
            if i >> k & 1 and k in K[j]:
                ans += 1
        if ans % 2 != p[j]:
            break
        else:
            anss += 1
print(ans)
Problem p03281 (python)

Fixed submission:
N=int(input())
count = 0
count2 = 0
for i in range(1,N+1):
    #print(i,"i")
    for j in range(1,N+1):
        #print(j,"k")
        if i % j == 0 :
            count += 1
            #print(count,"count")
    if count == 8 and i%2 != 0:
        count2 += 1
    ans = count2
    count = 0
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
count = 0
count2 = 0
for i in range(1,N+1):
    #print(i,"i")
    for j in range(1,N+1):
        #print(j,"k")
        if i % j == 0 :
            count += 1
            #print(count,"count")
    if count == 8 and i%2 != 0:
        count2 += 1
        ans = count2
    count = 0
    count2 = 0
print(ans)
Problem p02613 (python)

Fixed submission:
n=int(input())
d={'AC':0,"WA":0,'TLE':0,'RE':0}
for i in range(n):
    s=str(input())
    if(s=='AC'):
        d['AC']=d['AC']+1
    elif(s=='WA'):
        d['WA']=d['WA']+1
    elif(s=='RE'):
        d['RE']=d['RE']+1
    elif(s=='TLE'):
        d['TLE']=d['TLE']+1
print("AC x"+' '+str(d['AC']))
print('WA x'+' '+str(d['WA']))
print('TLE x'+' '+str(d['TLE']))
print('RE x'+' '+str(d['RE']))

Buggy submission (verdict: Runtime Error):
n=int(input())
d={'AC':0,"WA":0,'TLE':0,'RE':0}
for i in range(n):
    s=str(input())
    if(s=='AC'):
        d['AC']=d['AC']+1
    elif(s=='WA'):
        d['WA']=d['WA']+1
    elif(s=='RE'):
        d['RE']=d['RE']+1
    elif(s=='TLE'):
        d['TLE']=d['TLE']+1
print('AC'+" "+"*"+" "+str(d['AC']))
print('WA'+" "+"*"+" "+d['WA'])
print('TLE'+" "+"*"+" "+d['TLE'])
print('RE'+" "+"*"+" "+d['RE'])
Problem p02923 (python)

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

ans = []
now = 0

for i in range(1,n):
    if h[i-1] >= h[i]:
        now += 1
    else:
        ans.append(now)
        now = 0

ans.append(now)

print(max(ans))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(i) for i in input().split()]
e=a[0]
l=[]
for i in range(0,len(a)-1):
    f=0
    for j in range(i,len(a)-1):
        if(a[j+1]<=a[j]):
            f=f+1
        else:
            break
    l.append(f)
print(max(l))
Problem p02600 (python)

Fixed submission:
x=int(input())
if x in range(400,600):
    p=8
elif x in range(600,800):
    p=7
elif x in range(800,1000):
    p=6
elif x in range(1000,1200):
    p=5
elif x in range(1200,1400):
    p=4
elif x in range(1400,1600):
    p=3
elif x in range(1600,1800):
    p=2
elif x in range(1800,2000):
    p=1
print(p)

Buggy submission (verdict: Runtime Error):
n,k =map(int,input().split())
a=[int(x ) for x in input().split()]
for i in range(k,n):
    if a[i-k]>a[i-1]:
        print("Yes")
    else:
        print("No")
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a+a**2 +a**3)

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
n=0
for i in range(len(s)):
    if s[i]!=t[i]:
        
        n+=1
print(n)
Problem p03160 (python)

Fixed submission:
INT_MAX= 100000000
n=int(input())
dp  = [INT_MAX]*(100001)
h=[int(X) for X in input().split()]
dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(2,n):

    dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i-2]-h[i]))

print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n= int(input())
p =[int(x) for x in range(int(input()))]
dp = [[0 for i in range(n+1)]for j in range(n+1)]

dp[0][0]=1
for i in range(n):
    for j in range(n):
        dp[i+1][j+1]+=dp[i][j]*p[i]
        dp[i+1][j]+=dp[i][j]*(1-p[i])
an=0
for i in range((n+1)//2,n+1):
    an+=dp[n][i]
print(an)