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

Fixed submission:
def func(N):
    tmp=N
    arr=[]
    for i in range(2,int(-(-N**0.5//1))+1):
        if tmp%i==0:
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
            
    if tmp!=1:
        arr.append([tmp, 1])
    if arr==[]:
        arr.append([tmp,1])
   
    return arr

N=int(input())
a=func(N)
ans=0
if a[0][0]==1:
        print(0)
        exit()
        
b=[1,3,6,10,15,21,28,36,45]
for i in a:
    for j in range(len(b)):
       if  i[1]<b[j]:
          ans+=j
          break
print(ans)

Buggy submission (verdict: Runtime Error):
def func(N):
    tmp=N
    arr=[]
    for i in range(2,(N**0.5//1+1)):
        if tmp%i==0:
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
            
    if tmp!=1:
        arr.append([tmp, 1])
    if arr==[]:
        arr.append([tmp,1])
   
    return arr

N=int(input())
a=func(N)
ans=0
if a[0][0]==1:
        print(0)
        exit()
        
b=[1,3,6,10,15,21,28,36,45]
for i in a:
    for j in range(len(b)):
       if  i[1]<b[j]:
          ans+=j
          break
print(ans)

Buggy submission (verdict: Runtime Error):
def func(N):
    tmp=N
    arr=[]
    for i in range(2,int(-(-N**0.5//1))+1):
        if tmp%i==0:
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
            
    if temp!=1:
        arr.append([tmp, 1])
    if arr==[]:
        arr.append([n,1])
   
    return arr

N=int(input())
a=func(N)
ans=0
if a[0][0]==1:
        print(0)
        exit()
        
b=[1,3,6,10,15,21,28,36,45]
for i in a:
    for j in range(len(b)):
       if  i[1]<b[j]:
          ans+=j
          break
print(ans)

Buggy submission (verdict: Runtime Error):
def func(N):
    tmp=N
    arr=[]
    for i in range(2,int(-(-N**0.5//1))+1):
        if tmp%i==0:
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
            
    if temp!=1:
        arr.append([tmp, 1])
    if arr==[]:
        arr.append([tmp,1])
   
    return arr

N=int(input())
a=func(N)
ans=0
if a[0][0]==1:
        print(0)
        exit()
        
b=[1,3,6,10,15,21,28,36,45]
for i in a:
    for j in range(len(b)):
       if  i[1]<b[j]:
          ans+=j
          break
print(ans)

Buggy submission (verdict: Runtime Error):
def func(N):
    tmp=N
    arr=[]
    for i in range(2,int(-(-N**0.5//1))+1):
        if tmp%i==0:
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
    if arr==[] or temp!=1:
        arr.append([tmp,1])
   
    return arr

N=int(input())
a=func(N)
ans=0
if a[0][0]==1:
        print(0)
        exit()
        
b=[1,3,6,10,15,21,28,36,45]
for i in a:
    for j in range(len(b)):
       if  i[1]<b[j]:
          ans+=j
          break
print(ans)
Problem p03695 (python)

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

color=[]
free=0
Sans,Mans=0,0
for i in a:
    if i//400<8 and i//400 not in color:
        color.append(i//400)
        Sans+=1
    elif i>=3200:
        free+=1
        
#Mans=Sans
#if free+Sans>=8:
 #   Mans=8
#else:
 #   Mans=Sans+free

Mans=Sans+free
if Sans==0:
    Sans=1
print(Sans,Mans)

Buggy submission (verdict: Runtime Error):

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

color=[]
free=0
count=0
for i in a:
    if i//400<8 and i//400 not in color:
        color.append(i//400)
        Sans+=1
    elif i>=3200:
        free+=1
        
Mans=Sans
if free+count>8:
    Mans=8
else:
    Mans=count+free
    
print(Sans,Mans)
Problem p03721 (python)

Fixed submission:
n,k=map(int,input().split())
ans=[0]*(10**5+1)
for i in range(n):
    a,b=map(int,input().split())
    ans[a]+=b
    
v=0
for i in range(k):
    v+=ans[i]
    if ans[i]==0:
        i-=1
    if v>=k:
        a=i
        break
    
print(a)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans=[0]*(10**5+1)
for i in range(n):
    a,b=map(int,input().split())
    ans[a]+=b
    
for i in range(len(ba)):
    k-=ans[i]
    if k<=0:
        print(i)
        break

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans=[0]*10**5
for i in range(n):
    a,b=map(int,input().split())
    ans[a]+=b
    
v=0
for i in range(k):
    v+=ans[i]
    if ans[i]==0:
        i-=1
    if v>=k:
        a=i
        break
    
print(a)
Problem p02628 (python)

Fixed submission:
n, k = map(int, input().split())
li = [int(i) for i in input().split()]
newlist = sorted(li)
price = 0
for a in range(k):
  price += newlist[a]
  
print(price)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
li = [int(i) for i in input().split()]
newlist = sorted(li)
price = 0
for a in range(k):
  count += newlist[a]
  
print(count)
Problem p02789 (python)

Fixed submission:
n, m = map(int, input().split())
if n == m:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n, m = map(int(), input().split())
if n == m:
  print('Yes')
else:
  print('No')
Problem p02582 (python)

Fixed submission:
def function(X):
    if X=='SRS':
        return 1
    elif X[1] == 'S':
        if (X[0] == 'R') or (X[2] == 'R'):
            return 1
        else:
            return 0
    else:
        if (X[0] == 'R') and (X[2] == 'R'):
            return 3
        elif (X[0] == 'R') or (X[2] == 'R'):
            return 2
        else:
            return 0


if __name__ == '__main__':
    X = input()
    print(function(X))

Buggy submission (verdict: Runtime Error):
def function(X, K, D):
    kai = int(abs(X)/D)
    if kai >= K:
        if X > 0:
            ans = X-K*D
        else:
            ans = X+K*D
    else:
        K = K-kai
        if X > 0:
            X = X-kai*D
        else:
            X = X+kai*D
        if K % 2 == 1:
            if X > 0:
                ans = X-D
            else:
                ans = X+D
        else:
            ans = X
    return abs(ans)


if __name__ == '__main__':
    X, K, D = input().split()
    X = int(X)
    K = int(K)
    D = int(D)
    print(function(X, K, D))

Buggy submission (verdict: Runtime Error):
def function(X):
    if X='SRS':
        return 1
    elif X[1] == 'S':
        if (X[0] == 'R') or (X[2] == 'R'):
            return 1
        else:
            return 0
    else:
        if (X[0] == 'R') and (X[2] == 'R'):
            return 3
        elif (X[0] == 'R') or (X[2] == 'R'):
            return 2
        else:
            return 0


if __name__ == '__main__':
    X = input()
    print(function(X))
Problem p02602 (python)

Fixed submission:
def function(N, K, A):
    for i in range(0, N-K):
        if A[K+i] > A[i]:
            print('Yes')
        else:
            print('No')


if __name__ == '__main__':
    numbers = input().split()
    N = int(numbers[0])
    K = int(numbers[1])
    A = input().split()
    A = [int(a) for a in A]
    function(N, K, A)

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


def function(N, K, A):
    pre = [int(A[i]) for i in range(K)]
    for i in range(1, N-K+1):
        now = [int(A[i]) for i in range(i, K+i)]
        if np.prod(now) > np.prod(pre):
            print('Yes')
        else:
            print('No')
        pre = now


if __name__ == '__main__':
    numbers = input().split()
    N = int(numbers[0])
    K = int(numbers[1])
    A = input().split()
    function(N, K, A)
Problem p02639 (python)

Fixed submission:
list_sunuke = input().split()
list_m = []

for i in range(5):
    list_m.append(i+1)

for i in range(5):
    if int(list_sunuke[i]) != list_m[i]:
        print(list_m[i])

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

data_2 = []

x = int(xn[0]) #これに近い値
data.sort() #小さい順

#dataにない値が出るまでxから１引き続ける　１引き続けた値をaとする

a = x-1
while True:
    #check
    for i in range(len(data)):
        if int(data[i]) == a:
            a = a - 1
            break
        else:
            data_2.append(a)
            break
    if a == int(data_2[0]):
        break

#dataにない値が出るまでxから１足し続ける　１足し続けた値をbとする
b = x + 1
while True:
    #check
    for i in range(len(data)):
        if int(data[i]) == b:
            b = b + 1
            break
        else:
            data_2.append(b)
            break
    if b == int(data_2[1]):
        break

#aとbの小さい方をprint
if a < b:
    print(a)
else:
    print(b)

Buggy submission (verdict: Runtime Error):
list_sunuke = []
list_m = []

for i in range(5):
    list_sunuke.append(input())

for i in range(5):
    list_m.append(i+1)

for i in range(5):
    if list_sunuke[i] != list_m[i]:
        print(list_m[i])
        break

Buggy submission (verdict: Runtime Error):
list_sunuke = []
list_m = []

for i in range(5):
    list_sunuke.append(input())

for i in range(5):
    list_m.append(i+1)

for i in range(5):
    if list_sunuke[i] != list_m[i]:
        print(list_m[0])
        break
Problem p02640 (python)

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

doubutsu = int(listt[0])
ashi = int(listt[1])

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if ashi%2 == 0 and kame >= 0 and tsuru >= 0:
    print('Yes')
else:
    print("No")

Buggy submission (verdict: Runtime Error):
xn = input().split()
data_str = input().split()
data = [int(s) for s in data_str] #data_strをint型に変換

data_2 = []

x = int(xn[0]) #これに近い値
data.sort() #小さい順

print(data)

#dataにない値が出るまでxから１引き続ける　１引き続けた値をaとする
a = x-1
while True:
    #check
    for i in range(data):
        if data[i] == a:
            a = a - 1
        else:
            data_2.append(a)
            break
    if a == int(data_2[0]):
        break

#dataにない値が出るまでxかに１を足し続ける　１足し続けた値をbとする
b = x + 1
while True:
    #check
    for i in range(data):
        if int(data[i]) != b:
            data_2.append(b)
            print("bの値{}".format(b))
            break
        else:
            b = b + 1
            break
    if b == int(data_2[1]):
        break

#aとbの小さい方をprint
if abs(x-a) < abs(b-x):
    print(a)
else:
    print(b)

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

#doubutsu = 2 #X
#ashi = 100 #Y
doubutsu = int(listt[0])
ashi = int(listt[1])

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if type(kame) == int and type(tsuru) == int:
    if kame >= 0 and tsuru >= 0:
        print("Yes")
    elif kame == 0 and tsuru == 0;
        print('No')
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
doubutsu, ashi = input().split()

#doubutsu = 2 #X
#ashi = 100 #Y

kame = (ashi-2*doubutsu)/2
tsuru = doubutsu - kame

if type(kame) == int and type(tsuru) == int:
    if kame >= 0 and tsuru >= 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Problem p02641 (python)

Fixed submission:
xn = input().split()
data_2 = []
x = int(xn[0]) #これに近い値

if int(xn[1]) == 0:
    print(x)
else:
    data_str = input().split()
    data = [int(s) for s in data_str] #data_strをint型に変換
    data.sort() #小さい順
    #dataにない値が出るまでxから１引き続ける　１引き続けた値をaとする
    a = int(xn[0])
    #check
    while True: #while1
        while True: #while2
            for i in range(len(data)):
                if data[i] != a:
                    continue
                else:
                    a -= 1
                    break #forから抜け出す
            else:
                data_2.append(a)
                break #while2から抜け出す

        if len(data_2) == 1: #リストに１つデータが入っていたら　入ってないならwhile1ループ
            break #while1から抜け出す    


    #dataにない値が出るまでxかに１を足し続ける　１足し続けた値をbとする
    b = int(xn[0])
    while True: #while1
        while True: #while2
            for i in range(len(data)):
                if data[i] != b:
                    continue
                else:
                    b += 1
                    break #forから抜け出す
            else:
                data_2.append(b)
                break #while2から抜け出す

        if len(data_2) == 2: #リストに2つデータが入っていたら　入ってないならwhile1ループ
            break #while1から抜け出す  


    #aとbの小さい方をprint
    if abs(x-a) <= abs(b-x):
        print(a)
    else:
        print(b)

Buggy submission (verdict: Runtime Error):
xn = input().split()
data = input().split()
data_2 = []

x = xn[0] #これに近い値
data.sort() #小さい順

#dataにない値が出るまでxから１引き続ける　１引き続けた値をaとする

a = x-1
while True:
    #check
    for i in range(len(data)):
        if data[i] == a:
            a = a - 1
            break
        else:
            data_2.append(a)
            break
    if a == data_2[0]:
        break

#dataにない値が出るまでxから１足し続ける　１足し続けた値をbとする
b = x + 1
while True:
    #check
    for i in range(len(data)):
        if data[i] == a:
            a = a + 1
            break
        else:
            data_2.append(a)
            break
    if b == data_2[1]:
        break

#aとbの小さい方をprint
if a < b:
    print(a)
else:
    print(b)
Problem p02714 (python)

Fixed submission:
n = int(input())
s = input()
 
r_cnt = s.count('R')
g_cnt = s.count('G')
b_cnt = s.count('B')
 
ans = r_cnt * g_cnt * b_cnt
 
for i in range(n):
    for d in range(n):
        j = i + d
        k = j + d
        if k >= n:
            break
        if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            ans -= 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
S = input()

c=S.count
r,g,b=c('R'),c('G'),c('B')

ans = r*g*b

for i in range(N):
  for d in range(N):
    j = i+d
    k = j*d
    if k >= n:
      break
    if S[i] != S[j] and S[j] != S[k] and S[i] != S[i]:
      ans -= 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
S = input()

c=S.count
r,g,b=c('R'),c('G'),c('B')

ans = r*g*b

for i in range(n):
  for d in range(n):
    j = i+d
    k = j*d
    if k >= n:
      break
    if s[i] != s[j] and s[j] != s[k] and s[i] != s[i]:
      ans -= 1
    
print(ans)
Problem p02761 (python)

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

sc = []
for i in range(M):
    sc.append(list(map(int, input().split())))
for i in range(10**N):
    ans = str(i)
    if len(ans) == N and all(ans[s-1] == str(c) for s,c in sc):
        print(ans)
        quit()
print(-1)

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

sc = []
for i in range(m):
    sc.append(list(map(int, input().split())))
for i in range(10**N):
    ans = str(i)
    if len(ans) == N and all(ans[s-1] == str(c) for s,c in sc):
        print(ans)
        quit()
print(-1)

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

sc = []
for i in range(m):
    sc.append(list(map(int, input().split())))
for i in range(10**N):
    anc = str(i)
    if len(ans) == N and all(ans[s-1] == str(c) for s,c in sc):
        print(ans)
        quit()
print(-1)
Problem p02772 (python)

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
anc = 'APPROVED'
for i in a:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        anc = 'DENIED'
print(anc)

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

even = [i for i in a if a % 2 == 0]

cnt = 0
for e in even:
    if e % 3 == 0 or e % 5 == 0:
        cnt += 1
if cnt == len(even):
    print('APPROVED')
else:
    print('DENIED')
Problem p02898 (python)

Fixed submission:
N,K =map(int, input().split())
A=list(map(int, input().split()))
cnt = 0
for i in A :
    if i >= K:
        cnt +=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N,K =map(int, input().split())
A=list(map(int, input().split()))
cnt = 0
for i in A :
    if i >= k:
        cnt +=1
print(cnt)
Problem p02927 (python)

Fixed submission:
m,d = map(int,input().split())
if len(str(d)) == 2:
	d1,d2 = str(d)[0],str(d)[1]

cnt = 0
m_list = [i+1 for i in range(m)]

if len(str(d)) == 2:
  for i in range(d+1):
    
    if i >= 20:
      d1,d2 = str(i)[0],str(i)[1]
      if d1=='1' or d2=='1':
        continue
      if int(d1)*int(d2) in m_list:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
m,d = map(int,input().split())
d1,d2 = str(d)[0],str(d)[1]
cnt = 0
m_list = [i+1 for i in range(m)]
for i in range(d):
  if i >= 20:
    d1,d2 = str(i)[0],str(i)[1]
    if d1=='1' or d2=='1':
      continue
    if int(d1)*int(d2) in m_list:
      
      cnt += 1
print(cnt)
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())
res = 'No'
for i in range(x+1):
  k = x-i
  if(i*2 + k*4) == y:
    res = 'Yes'
print(res)

Buggy submission (verdict: Runtime Error):
    x, y = map(int, input().split())
    for i in range(x+1):
      if((i*2 + (x-i)*4) == y):
        print("Yes")
    	break
      else:
    	print("No")
    	break

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
for i in range(x+1):
  if((i*2 + (x-i)*4) == y) or ((i*4 +(x-i)*2) == y):
    print("Yes")
	break
  else:
	print("No")
	break

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
for i in range(x+1):
  if(i*2 + (x+1-i)*4) == y or (i*4 + (x+1-i)*2) == y:
	print("Yes")
  else:
    print("No")
  break
Problem p02658 (python)

Fixed submission:
def main():
	N = int(input())
	A = list(map(int, input().split()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main()

Buggy submission (verdict: Runtime Error):
    from functools import reduce
    n = int(input())
    tab = [int(n) for n in input().split()]
    if 0 in tab:
      print("0")
    res = reduce(lambda x, y: x*y, tab)
    if res > 1000000000000000000:
      print("-1")
    else:
      print(res)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
if s +t[-1]==t:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input().split()
a = input().split()
if s+a[-1]==a:
  print("yes")
else:
  print("no")
Problem p02690 (python)

Fixed submission:
x = int(input())

def fun(x):

    res = []

    for a in range(-1000, 1000):
        for b in range(-1000, 1000):
            mult = a**5 - b**5
            if mult == x:
                res = a, b
                break
    print(res[0], res[1])

fun(x)

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

def fun(x):

    res = []

    for a in range(-100, 100):
        for b in range(-100, 100):
            mult = a**5 - b**5
            if mult == x:
                res = a, b
                break
    print(res[0], res[1])

fun(x)
Problem p02732 (python)

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

from collections import defaultdict

resdict = {}

from collections import Counter

c = Counter(alist)

cdict = dict(c)

# cdict = dict((key, value) for (key, value) in old_cdict.items() if value >= 2)

# print(cdict)

maxi = 0

for k, v in cdict.items():
    maxi += v * (v - 1) // 2

for a in alist:
    num = cdict[a]
    if num in resdict:
        # print('used')
        print(resdict[num])
        continue
    # print('not used')
    if a in cdict:
        cdict[a] -= 1
        temp = 0
        for k,v in cdict.items():
            temp += v*(v-1)//2
        print(temp)
        resdict[num] = temp
        cdict[a] += 1
    else:
        print(maxi)

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

from collections import defaultdict

resdict = {}

from collections import Counter

c = Counter(alist)

old_cdict = dict(c)

cdict = dict((key, value) for (key, value) in old_cdict.items() if value >= 2)

# print(cdict)

maxi = 0

for k, v in cdict.items():
    maxi += v * (v - 1) // 2

for a in alist:
    num = cdict[a]
    if num in resdict:
        # print('used')
        print(resdict[num])
        continue
    # print('not used')
    if a in cdict:
        cdict[a] -= 1
        temp = 0
        for k,v in cdict.items():
            temp += v*(v-1)//2
        print(temp)
        resdict[num] = temp
        cdict[a] += 1
    else:
        print(maxi)
Problem p02814 (python)

Fixed submission:
from functools import reduce
from math import ceil

n, m = map(int, input().split(' '))

alist = list(map(int,input().split(' ')))
# alist = [i // 2  for i in alist]


from fractions import gcd

def getLCM(a, b):
    return a * b // gcd(a, b)

def get_lcm_for(your_list):
    return reduce(lambda x, y: getLCM(x, y), your_list)

lcmr = get_lcm_for(alist)

for a in alist:
    if (lcmr//a)%2 == 0:
        if (lcmr != a):
            print(0)
            exit(0)

result = m//lcmr + 2*m//lcmr%2


print(result)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split(' '))
from functools import reduce
alist = list(map(int,input().split(' ')))
alist = [i // 2  for i in alist]


from math import gcd

def getLCM(a, b):
    return a * b // gcd(a, b)

def get_lcm_for(your_list):
    return reduce(lambda x, y: getLCM(x, y), your_list)

lcmr = get_lcm_for(alist)

result = (m + lcmr)//(lcmr*2)


print(result)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split(' '))
from functools import reduce
alist = list(map(int,input().split(' ')))
alist = [i // 2  for i in alist]


from math import gcd

def getLCM(a, b):
    return a * b // gcd(a, b)

def get_lcm_for(your_list):
    return reduce(lambda x, y: getLCM(x, y), your_list)

lcmr = get_lcm_for(alist)

result = (m + lcmr)//(lcmr*2)


print(result)
Problem p02921 (python)

Fixed submission:
predict = input()

actual = input()

count = 0

for index in range(0, len(predict)):
    if predict[index] == actual[index]:
        count += 1

print (count)

Buggy submission (verdict: Runtime Error):
predict = raw_input()

actual = raw_input()

count = 0

for index in range(0, len(predict)):
    if predict[index] == actual[index]:
        count += 1

print (count)
Problem p02582 (python)

Fixed submission:
s=[str(i) for i in input()]
if s[0]=='R' and s[1]=='S':
	print(1)
elif s[1]=='S' and s[2]=='R':
	print(1)
elif s[0]=='S' and s[1]=='R' and s[2]=='S':
	print(1)
elif s[0]=='R' and s[1]=='R' and s[2]=='S':
	print(2)
elif s[0]=='S' and s[1]=='R' and s[2]=='R':
	print(2)
elif s[0]=='R' and s[1]=='R' and s[2]=='R':
	print(3)
else:
	print(0)

Buggy submission (verdict: Runtime Error):
s=[str(i) for i in input()]
if str[0]=='R' and str[1]=='S':
	print(1)
elif str[1]=='S' and str[2]=='R':
	print(1)
elif str[0]=='S' and str[1]=='R' and str[2]=='S':
	print(1)
elif str[0]=='R' and str[1]=='R' and str[2]=='S':
	print(2)
elif str[0]=='S' and str[1]=='R' and str[2]=='R':
	print(2)
elif str[0]=='R' and str[1]=='R' and str[2]=='R':
	print(3)
else:
	print(0)
Problem p02700 (python)

Fixed submission:
A,B,C,D = (int(x) for x in input().split())
f = True
while True:
    if f:
        C = C - B
        f = False
    else:
        A = A - D
        f = True
    if A <= 0:
        print('No')
        break
    elif C <= 0:
        print('Yes')
        break
    else:
        continue

Buggy submission (verdict: Runtime Error):
f = True
while True:
    if f:
        C = C - B
        f = False
    else:
        A = A - D
        f = True
    if A <= 0:
        print('No')
        break
    elif C <= 0:
        print('Yes')
        break
    else:
        continue
Problem p02741 (python)

Fixed submission:
list_1 = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(list_1[k-1])

Buggy submission (verdict: Runtime Error):
list_1 = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(list_1[k])
Problem p02582 (python)

Fixed submission:
weather = input()

if weather in ["RRR"]:
    print("3")
elif weather in ["SRR","RRS"]:
    print("2")
elif weather in ["SSR","SRS","RSS","RSR"]:
    print("1")
else:
    print("0")

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

elif weather in ["RRR"]:
    print("3")
elif weather in ["SRR","RRS"]:
    print("2")
elif weather in ["SSR","SRS","RSS","RSR"]:
    print("1")
else:
    print("0")

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

if weather in [RRR]:
    print("3")
elif weather in [RR]:
    print("2")
elif weather in [R]:
    print("1")
else:
    print("0")