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

Fixed submission:
N =int(input())
ans = ""

while True:
  N-=1
  matsubi = N%26
  matsubi = chr(96+matsubi+1)
  ans += matsubi

  if N//26 == 0:
      break
  else:
      N//=26

ans = ans[::-1]
print(ans)

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

while True:
    if N <= 26:
        matsubi = chr(96+N)
        ans += matsubi
        break
    else:
        if N % 26==0:
            matsubi = "z"
        else:
            a = int(N%26)
            matsubi = chr(96+a)
        ans += matsubi
        if N>26:
            N /= 26
    # if N<26:
    #     last = chr(96+N)
    #     ans += last
    #     break


ans2 = ans[::-1]
print(ans2)
Problem p02682 (python)

Fixed submission:
A,B,C,K = map(float,input().split())
 
a = min(A, K)
if K-A>=0:
    b = min(abs(K-A), B)
else:
    b = 0
    c = 0

if K-A-B>=0:
    c = min(abs(K-A-B), C)
else:
    c = 0

ans = 1*a + 0*b - 1*c

print(int(ans))

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

ans = 0
if K-A>0:
    ans += A*1
    K -= A
    judge = 1
elif K-A==0:
    #ここで終わり
    ans += A*1
    judge = 0



judgeB=1
if judge==1 and K-B>0:
    K -= B
    
elif judge==1 and K-B<=0:
    K-=B
    judgeB = 0
    


if judgeB==1:
    ans += -1*K

print(ans)
Problem p02701 (python)

Fixed submission:
N = int(input())

a = []
for i in range(N):
    S = str(input())
    a.append(S)

count = len(list(set(a)))
print(count)

Buggy submission (verdict: Runtime Error):
N = input()
a = []
for i in range(N):
  f = input()
  a.append(f)
  
a=list(set(a))

print(len(a))
Problem p02754 (python)

Fixed submission:
N,A,B = map(int,input().split())
C = A+B

ans1 = N//C*A
if N%C > A:
    ans2 = A
else:
    ans2 = N%C

print(ans1+ans2)

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

a = ""

blue = 'b'*A
red = 'r'*B
cnt = 0
while cnt<1000:
    a+=blue
    cnt+=1
    a+=red
    cnt+=1

target = a[0:N]
print(target)
num = target.count('b')
print(num)
Problem p02659 (python)

Fixed submission:
import sys
import decimal
def input():
    return sys.stdin.readline().strip()
 
def main():
    A, B = input().split()
    A = decimal.Decimal(A)
    B = decimal.Decimal(B)
    print(int(A*B))
 
 
main()

Buggy submission (verdict: Runtime Error):
import sys
def input():
    return sys.stdin.readline().strip()

def main():
    A, B = input().split()
    if int(A) == 0 or int(B) == 0:
        print(0)
        return
    A = int(A)
    B = int(float(B)*100)
    print(A*B//100)


main()
Problem p02729 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
m = int(input())
sum = 0
sum = n*(n-1)/2 + m*(m-1)/2
print(sum)
Problem p03038 (python)

Fixed submission:
n,m = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
e =0
bc = []
for i in range(m):
    d = list(map(int,input().split()))
    bc.append([d[1],d[0]])
    e += d[0] 
#print(a)  
 
 
bc.sort()
bc.reverse()
#print(bc)
 
#print(e)
#print(a[n-1])
j = 0
for i in range(n):
    if j == bc[0][1] :
        bc.remove(bc[0])
        j = 0
    if bc[0][0] > a[i]:
        a[i] = bc[0][0]
        j += 1
    else:
        break
    if i == e-1:
        break
 
 
#print(a)
print(sum(a))

Buggy submission (verdict: Runtime Error):
import cProfile
n,m = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
s = []
for i in range(m):
    b,c = map(int,input().split())
    s += [c]*b
    
s.sort()
s.reverse()
d = max(n,len(s))

for i in range(n):
    if s[0] > a[i]:
        a[i] = s[0]
        s.remove(s[0])
    else:
        break
    if i == d-1:
        break


print(sum(a))
#cProfile.run()

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
s = []
for i in range(m):
    b,c = map(int,input().split())
    for j in range(b):
        s.append(c)
s.sort()
s.reverse()
d = max(n,len(s))

for i in range(n):
    if s[0] > a[i]:
        a[i] = s[0]
        s.remove(s[0])
    else:
        break
    if i == d-1:
        break


print(sum(a))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
s = []
for i in range(m):
    b,c = map(int,input().split())
    for j in range(b):
        s.append(c)
s.sort()
s.reverse()
d = max(n,len(s))

for i in range(n):
    if s[0] > a[i]:
        a[i] = s[0]
        s.remove(s[0])
    if i == d-1:
        break


print(sum(a))
Problem p02729 (python)

Fixed submission:
IN=input()
M=int(IN.split(" ")[0])
N=int(IN.split(" ")[1])

count=0

if M >= 2:
    x=M*(M-1)
    count=x/2

if N >= 2:
    x=N*(N-1)
    count=x/2 + count

print(int(count))

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

count=0

if M >= 2:
    x=M*(M-1)
    print("M",x)
    count=x/2

if N >= 2:
    x=N*(N-1)
    print("N",x)
    count=x/2 + count

print(int(count))
Problem p02693 (python)

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

ans = 'NG'
for i in range(a,b+1):
	if i%k == 0:
		ans = 'OK'

print(ans)

Buggy submission (verdict: Runtime Error):
def f(vs,i):
	# print(vs)
	for j in range(len(vs)):
		if vs[j]+i in vs:
			a = vs[j]
			b = vs[j]+i
			print(a,b)
			vs.remove(a)
			vs.remove(b)
			return

n,m = map(int,input().split())
vs = list(range(1,n+1))

for i in range(1,m+1):
	f(vs,i)
Problem p02688 (python)

Fixed submission:
N,K=map(int,input().split())
D=[]
A=set()
for i in range(K):
	D.append(int(input()))
	A=A|set(map(int,input().split()))
length=len(A)
print(N-length)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
D=[]
A=set()
for i in range(K):
	D.append(input())
	A.add(int(input()))
S=len(A)
print(N-S)
Problem p02699 (python)

Fixed submission:
S, W = (int(x) for x in input().split())
if W>=S:
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
S, W = (int(x) for in input().split())
if W>=S:
  print("unsafe")
else:
  print("safe")
Problem p02723 (python)

Fixed submission:
S=input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
if S[2]==S[3]andS[4]==S[5]:
  print("Yes")
else:
  print("No")
Problem p02753 (python)

Fixed submission:
S = input()
if S=="AAA" or S=="BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S = input()
if S=="AAA" or S="BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S = input()
if S=="AAA" or S="BBB":
  print("No")
else:
  print("Yes")
Problem p02785 (python)

Fixed submission:
import sys

N, K = (int(x) for x in input().split())
H = list(map(int, input().split()))
ans=0

if K>=N:
  print(0)
  sys.exit(0)
  
H.sort(reverse=True)
del H[0:K]
for i in range(len(H)):
  ans+=H[i]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

N, K = (int(x) for x in input().split())
H = list(map(int, input().split()))
ans=0

if K>=N:
  print(0)
  sys.exit(0)
  
H.sort(reverse=True)
for i in range(K):
  del H[i]
for i in range(len(H)):
  ans+=H[i]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

N, K = (int(x) for x in input().split())
H = list(map(int, input().split()))
ans=0

if K>=N:
  print(0)
  sys.exit(0)
  
H.sort(reverse=True)
for i in range(K):
  del H[i]
for i in range(N-K):
  ans+=H[i]
print(ans)
Problem p02707 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
Ansbox = [0]*(N+1)

def count(N,A,Ansbox):

    for i in range(N- 1):
        Ansbox[A[i] - 1] += 1
        
    for i in range(N):
        print(Ansbox[i])
        
count(N,A,Ansbox)

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

    for i in range(N):
        print(A.count(i+1))
        A.remove(i+1)
count()

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

def count(N,A):
    for i in range(N):
        print(A.count(i+1))
        A.remove(i+1)
count(N,A)
Problem p02831 (python)

Fixed submission:

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

def gcd(a,b):
    if a%b==0:
        return b
    else:
        return gcd(b,a%b)
ans = a*b//gcd(a,b)
print(ans)

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

ans = int(a * b / np.gcd(a,b))

print(ans)

Buggy submission (verdict: Runtime Error):

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

import numpy as np
ans = int(a * b / np.gcd(a, b))

print(ans)

Buggy submission (verdict: Runtime Error):

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

import math
ans = int(a * b / math.gcd(a, b))

print(ans)
Problem p03804 (python)

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

A = [[0]]*N
B = [[0]]*M

for i in range(N):
    A[i] = input()
for j in range(M):
    B[j] = input()

judge = False 

#行同士で比較していく
for k in range(N-M+1):
    for i in range(N-M+1):
        count = 0
        for j in range(M):
            if B[j]==A[j+i][k:k+M]:
                count += 1
                
                if count == M:
                    judge = True
                    break
            
if judge == True:
    print("Yes")
else:
    print("No")

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

A = [[0]]*(N+1)
A[N] = str("a")*50
B = [[0]]*M

for i in range(N):
    A[i] = input()
for j in range(M):
    B[j] = input()

judge = False 

if M==1:
    for j in range(M):
        for i in range(N):
            for k in range(N):
                if B[j]==A[i][k]:
                    judge = True


count = 0   
for i in range(N-M+1):
    for j in range(M):
        if B[j]==A[i][i:i+M] and B[j+1]==A[i+1][i:i+M]:
            count += 1
            
            if count == M - 1:
                judge = True
                break
            
if judge == True:
    print("Yes")
else:
    print("No")

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

A = [[0]]*(N+1)
A[N] = str("a")*50
B = [[0]]*M

for i in range(N):
    A[i] = input()
for j in range(M):
    B[j] = input()

judge = False 
count = 0   
for i in range(N-M+1):
    for j in range(M):
        if B[j]==A[i][i:i+M] and B[j+1]==A[i+1][i:i+M]:
            count += 1
            
            if count == M - 1:
                judge = True
                break
if judge == True:
    print("Yes")
else:
    print("No")

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

A = [[0]]*(N+1)
B = [[0]]*M

for i in range(N):
    A[i] = input()
for j in range(M):
    B[j] = input()

judge = False 
count = 0   
for i in range(N-M+1):
    for j in range(M):
        if B[j]==A[i][i:i+M] and B[j+1]==A[i+1][i:i+M]:
            count += 1
            
            if count == M - 1:
                judge = True
                break
if judge == True:
    print("Yes")
else:
    print("No")

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

A = [[0]]*(N+1)
B = [[0]]*M

for i in range(N):
    A[i] = input()
for j in range(M):
    B[j] = input()
 
count = 0   
for i in range(N-M+1):
    for j in range(M):
        if B[j]==A[i][i:i+M] and B[j+1]==A[i+1][i:i+M]:
            count += 1
            
            if count == M - 1:
                print("Yes")
                break
if count != M-1 or count==0:
    print("No")
Problem p02688 (python)

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

have = []
result = 0

for i in range(N):
    have.append([1]*K)


for i in range(K):
    d = int(input())
    
    A = input().split()
    A = map(int,A)

    for a in A:
        have[a-1][i-1] = 0

        
for j in have:
    if j == [1]*K:
        result += 1

print(result)

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

have = []
result = 0

for i in range(N):
    have.append([1]*K)


for i in range(K):
    d = int(input())
    A = input().split()
    A = map(int,A)

    for a in A:
        have[a-1][d-1] = 0

        
for j in have:
    if j == [1]*K:
        result += 1

print(result)

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

have = []
result = 0

for i in range(N):
    have.append([0]*K)


for i in range(K):
    d = int(input())
    A = input().split()
    A = map(int,A)

    for a in A:
        if have[a-1][d-1] == 0:
            have[a-1][d-1] = 1
        
for j in have:
    if j == [0]*K:
        result += 1

print(result)

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

have = []
result = 0

for i in range(N):
    have.append([0]*K)


for i in range(K):
    d = int(input())
    A = input().split()
    A = map(int,A)

    for a in A:
        have[a-1][d-1] = 1
        
for j in have:
    if j == [0]*K:
        result += 1

print(result)

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

have = []
result = 0

for i in range(N):
    have.append([0]*K)


for i in range(K):
    d = int(input())
    A = input().split()
    A = map(int,A)

    for a in A:
        have[a-1][d-1] = 1

for j in have:
    if j == [0,0]:
        result += 1

print(result)
Problem p02689 (python)

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

A = [[] for i in range(N+1)]
for i in range(N+1):
    A[i].append(H[i-1])
for i in range(M):
    a,b = map(int, input().split())
    A[a].append(H[b-1])
    A[b].append(H[a-1])

ans = 0
for i in range(1,N+1):
    if max(A[i]) == A[i][0] and A[i].count(A[i][0]) < 2:
        ans += 1

print(ans)

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

x = list(range(N+1))

for i in range(N-1):
    a,b = map(int, input().split())
    if H[a-1] > H[b-1]:
        x[b] = 0
    elif H[a-1] < H[b-1]:
        x[a] = 0
    else:
        x[a] = 0
        x[b] = 0

x = set(x)
print(len(x)-1)

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

A = [[] for i in range(N+1)]
for i in range(N+1):
    A[i].append(H[i-1])
for i in range(M):
    a,b = map(int, input().split())
    A[a].append(H[b-1])
    A[b].append(H[a-1])

ans = 0

for i in range(1,N+1):
    x = sorted(set(A[i]))
    if x[-1] == H[i-1]:
        q = sorted(A[i])
        if q[-1] != q[-2]:
            ans += 1

    if len(A[i]) != 1 and len(x) == 1:
        ans -= 1
print(ans)
Problem p03075 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
#a < b < c < d < e

f = abs(e - a)
if k >= f:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
f = abs(e - a)
if k >= f:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
a < b < c < d < e

f = abs(e - a)
if k >= f:
    print('Yay!')
else:
    print(':(')
Problem p03315 (python)

Fixed submission:
s = input()
n = s.count('+')
print(2*n - 4)

Buggy submission (verdict: Runtime Error):
s = input()
n == 0
for i in 4:
    if s[i-1] == '+':
        n += 1
    else:
        n -= 1
print(n)
Problem p03631 (python)

Fixed submission:
n = input()
if n[0] == n[-1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if n[0] == n[-1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if str(n[0]) = str(n[2]):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if str(n[0]) == str(n[2]):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if n[0] == n[2]:
    print('Yes')
else:
    print('No')
Problem p02711 (python)

Fixed submission:
n = input()
print("Yes" if n.count("7") >= 1 else "No")

Buggy submission (verdict: Runtime Error):
n = input()
print("Yes" if s.count("7") >= 1 else "No")
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = int(input())
print(a*b if a < 10 and b < 10 else -1)
Problem p02990 (python)

Fixed submission:
from math import factorial

def comb(a,b):
    return factorial(a) // factorial(b) // factorial(abs(a-b))

n, k = map(int, input().split())
for i in range(k):
    print(comb(k-1, i) * comb(n-k+1, i+1) % 1000000007)

Buggy submission (verdict: Runtime Error):
from math import factorial

def a(n,k):
  return factorial(n)//factorial(k)//factorial(n-k)

n,k = map(int,input().split())
mod = 10**9 + 7

for i in range(k):
  print(a(n-k+1,i+1)*a(k-1,i)%mod)

Buggy submission (verdict: Runtime Error):
from math import factorial
n,k = map(int,input().split())
mod = 10**9 + 7

def a(n,k):
  return factorial(n)//factorial(k)//factorial(n-k)

for i in range(k):
  print(a(n-k+1,i+1)*a(k-1,i)%mod)
Problem p03315 (python)

Fixed submission:
s = input()
print(s.count("+") - s.count("-"))

Buggy submission (verdict: Runtime Error):
a = input()
s = list(a)
n = 0

for i in s:
  n += int(i)

print("Yes" if int(a)%n == 0 else "No")
Problem p02688 (python)

Fixed submission:
n,k=map(int,input().split())
LI=list(range(1,n+1))
kari=n+1
for i in range(1,k+1):
  d=int(input())
  li=list(map(int,input().split()))
  for x in range(1,n+1):
    if li.count(x)!=0:
      if LI.count(x)!=0:
        LI.remove(x)
print(len(LI))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
LI=list(range(1,n+1))
kari=n+1
for i in range(k):
  d=int(input())
  li=list(map(int,input().split()))
  for x in range(1,n):
    if li.count(x)!=0:
      LI.remove(x)
print(len(LI)-1)
Problem p02847 (python)

Fixed submission:
s=input()
li=["MON","TUE","WED","THU","FRI","SAT","SUN"]
if s=="SUN":
  print(7)
else:
  print(6-(li.index(s)))

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
n=0
moji=str(n)
y=len(moji)
money=a*n+b*y
while money<=x:
  n=n+1
  moji=str(n)
  y=len(moji)
  money=a*n+b*y
print(n-1)
Problem p02897 (python)

Fixed submission:
n=int(input())
cnt=0
ans=0
for i in range(1,n+1):
  cnt+=1
  if i%2==1:
    ans+=1
    
print(ans/cnt)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
LIST=list(map(int,input().split()))
kazu=0
for i in LIST:
  if i>=k:
    kazu=kazu+1
print (kazu)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
LIST=list(map(int,input().split()))
kazu=0
for i in LIST:
  if i>=k:
    kazu=kazu+1

print (kazu)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
LIST=list(map(int,input().split()))
kazu=0
for i in LIST:
  if i>=k:
    kazu=kazu+1
print (kazu)
Problem p02688 (python)

Fixed submission:
n, k = map(int, input().split())
all_sunuke = [1]*n

for i in range(0,k):
  d = int(input())
  a = list(map(int, input().split()))
  for j in range(0,d):
      all_sunuke[(a[j]-1)] =all_sunuke[(a[j]-1)]*0

print(sum(all_sunuke))

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

for i in range(1,k):
  d.append(int(input()))
  a.append(list(map(int, input().split())))
  
all_sunuke = [1]*n

for j in range(0, k):
  for m in range(0, d[j]):
    if a[m] != 0:
      all_sunuke[m] =all_sunuke[m]*0

print(sum(all_sunuke))
Problem p02659 (python)

Fixed submission:
C = input().split()

A = int(C[0])
B = int(float(C[1])*100+0.5)



E = A*B



if E < 100:
    print(0)
elif E < 200:
    print(1)
elif E < 300:
    print(2)
else:
    F = str(E)
    print(F[0:len(F)-2])

Buggy submission (verdict: Runtime Error):
C = input().split()

A = int(C[0])
B = int(C[1]*100)



E = A*B

F = E/100

print(F)

Buggy submission (verdict: Runtime Error):
C = input().split()

A = int(C[0])
B = int(C[1]*100)



E = A*D

F = E/100

print(F)
Problem p02682 (python)

Fixed submission:
a,b,c,k=map(int, input().split())
if a+b-k>=0:
    print(min(a,k))
else:
    print(2*a-k+b)

Buggy submission (verdict: Runtime Error):
a,b,c,k=map(int, input().split())
if a+b-k>=0:
    print(min(a,k))
else:
    print(a-(k-(a+b))
Problem p02951 (python)

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

if n[2]-n[0]+n[1] > 0:
  print(n[2]-n[0]+n[1])
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n <= 9:
  print(n)
elif n <= 99:
  print(9)
elif n <= 999:
  print(9+n-100+1)
elif n <= 9999:
  print(909)
elif n <= 99999:
  print(909+n-10000+1)
else:
  print(90909)
Problem p02987 (python)

Fixed submission:
ls = list(input())
if ls[0] == ls[1] and ls[2] == ls[3] and ls[0] != ls[2]:
  print('Yes')
elif ls[0] == ls[2] and ls[1] == ls[3] and ls[0] != ls[1]:
  print('Yes')
elif ls[0] == ls[3] and ls[1] == ls[2] and ls[0] != ls[1]:
  print('Yes')
else:
  print('No')

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

c = 0
for i in range(1, n-1):
  if ls[i] > ls[i-1] and ls[i] < ls[i+1]:
    c += 1
  elif  ls[i] < ls[i-1] and ls[i] > ls[i+1]:
    c += 1
    
print(c)
Problem p02693 (python)

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

ans = "NG"

for v in range(a, b+1):
    c = v % k
    if c == 0:
        ans = "OK"
        break

print(ans)

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

ans = 0

for v in range(1, n+1):
    m = ((a * v)/ b) // 1
    l = a * ((v/b)//1)
    if ans < (m - l):
        ans = (m - l)
print(int(ans))
Problem p02729 (python)

Fixed submission:
m, n = list(map(int, input().split(" ")))
ans = int((m * (m - 1))/ 2) + int((n * (n - 1))/ 2)
print(ans)

Buggy submission (verdict: Runtime Error):
print((int(input())/3)**3)
Problem p03013 (python)

Fixed submission:
mod = 1000000007

n, m = list(map(int, input().split()))
nums = [int(input()) for _ in range(m)]
 
dp = [1] + [0 for _ in range(n)]

if len(nums) > 0 and nums[0] == 1:
	del nums[0]
else:
	dp[1] = 1
	

for i in range(2, n + 1):
	#print(i, dp, nums)
	if len(nums) ==  0:
		dp[i] = (dp[i - 1] + dp[i - 2]) % mod
	else:
		for j in range(len(nums)):
			if nums[j] > i:
				dp[i] = (dp[i - 1] + dp[i - 2]) % mod
				break
			elif nums[j] == i:
				del nums[:(j + 1)]
				break
#print(nums)
#print(dp)
print(dp[-1])

Buggy submission (verdict: Runtime Error):
mod = 1000000007

n, m = list(map(int, input().split()))
nums = [int(input()) for _ in range(m)]
 
dp = [1] + [0 for _ in range(n)]

if nums[0] == 1:
	del nums[0]
else:
	dp[1] = 1
	

for i in range(2, n + 1):
	#print(i, dp, nums)
	if len(nums) ==  0:
		dp[i] = (dp[i - 1] + dp[i - 2]) % mod
	else:
		for j in range(len(nums)):
			if nums[j] > i:
				dp[i] = (dp[i - 1] + dp[i - 2]) % mod
				break
			elif nums[j] == i:
				del nums[:(j + 1)]
				break
#print(nums)
#print(dp)
print(dp[-1])

Buggy submission (verdict: Runtime Error):
mod = 1000000007

n, m = list(map(int, input().split()))
nums = [int(input()) for _ in range(m)]
 
dp = [1] + [0 for _ in range(n)]

if nums[0] == 1:
	del nums[0]
else:
	dp[1] = 1
	

for i in range(2, n + 1):
	#print(i, dp, nums)
	if len(nums) ==  0:
		dp[i] = (dp[i - 1] + dp[i - 2]) % mod
	else:
		for j in range(len(nums)):
			if nums[j] > i:
				dp[i] = (dp[i - 1] + dp[i - 2]) % mod
				break
			elif nums[j] == i:
				del nums[:(j + 1)]
				break
#print(nums)
#print(dp)
print(dp[-1])

Buggy submission (verdict: Runtime Error):
import bisect
mod = 1000000007

n, m = list(map(int, input().split()))
nums = [int(input()) for _ in range(m)]
 
dp = [1] + [0 for _ in range(n)]

if nums[0] != 1:
	dp[1] = 1
	idx = bisect.bisect_right(nums, 1)
	nums = nums[idx:]

for i in range(2, n + 1):
	if i in nums:
		dp[i] = 0
		idx = bisect.bisect_right(nums, 1)
		nums = nums[idx:]
	else:
		dp[i] = (dp[i - 1] + dp[i - 2])  % mod

print(dp[-1])