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

Fixed submission:
from heapq import heappush, heappop

N, K = map(int, input().split(' '))
h = []
for _ in range(N):
    t, d = map(int, input().split(' '))
    heappush(h, (-d, t))

dsum = 0
used = {}
q = []
for _ in range(K):
    d, t = heappop(h)
    if t not in used:
        used[t] = 1
    else:
        heappush(q, (-d, t))
    dsum += -d
res = len(used)**2 + dsum

while h and q:
    d, t = heappop(h)
    if t not in used:
        used[t] = 1
        m, _ = heappop(q)
        dsum = dsum - m - d
        res = max(res, len(used)**2 + dsum)
print(res)

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

N, K = map(int, input().split(' '))
TD = [[int(v) for v in input().split(' ')] for _ in range(N)]

dp = np.zeros((K+1, N+1), dtype=float)
nt = [['']*(N+1) for _ in range(K+1)]
for i in range(1, K+1):
    for j in range(1, N+1):
        
        if str(TD[j - 1][0]) in list(nt[i-1][j-1]):
            t_dp = dp[i - 1, j - 1] + TD[j - 1][1]
        else:
            v = len(nt[i - 1][j - 1])
            t_dp = dp[i - 1, j - 1] + TD[j - 1][1] - v**2 + (v+1)**2

        if dp[i, j-1] >= t_dp:
            dp[i, j] = dp[i, j-1]
            nt[i][j] = nt[i][j-1]
        else:
            dp[i, j] = t_dp
            if str(TD[j-1][0]) not in list(nt[i-1][j - 1]):
                nt[i][j] = nt[i-1][j - 1] + str(TD[j-1][0])
            else:
                nt[i][j] = nt[i - 1][j - 1]

print(int(dp[K, N]))
Problem p03292 (python)

Fixed submission:
tasks = input()

tasks = [int(t) for t in tasks.split()]

# 0, 1, 2
cost0 = abs(tasks[1] - tasks[0]) + abs(tasks[2] - tasks[1])

# 0, 2, 1
cost1 = abs(tasks[2] - tasks[0]) + abs(tasks[2] - tasks[1])

# 1, 0, 2
cost2 = abs(tasks[1] - tasks[0]) + abs(tasks[2] - tasks[0])

# 1, 2, 0
cost3 = abs(tasks[1] - tasks[2]) + abs(tasks[2] - tasks[0])

# 2, 0, 1
cost4 = abs(tasks[2] - tasks[0]) + abs(tasks[0] - tasks[1])

# 2, 1, 0
cost5 = abs(tasks[2] - tasks[1]) + abs(tasks[0] - tasks[1])

min_cost = min([cost0, cost1, cost2, cost3, cost4, cost5])

print(min_cost)

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

arr = [int(a) for a in input().split()]

max_mod = 0
for i in range(1, max(arr)):

    cur_mod = 0
    for a in arr:
        cur_mod += i % a

    max_mod = max(max_mod, cur_mod)

print(max_mod)

Buggy submission (verdict: Runtime Error):
str1 = input()
str2 = input()

if str1 == str2:
    print('Yes')

for i in range(len(str1) - 1):

    str1 = str1[-1] + str1[:-1]

    if str1 == str2:
        print('Yes')
        break

if str1 != str2:
    print('No')

Buggy submission (verdict: Runtime Error):
str1 = input()
str2 = input()

if str1 == str2:
    print('Yes')

for i in range(len(str1) - 1):
    
    str1 = str1[-1] + str1[:-1]
    
    if str1 == str2:
        print('Yes')

print('No')
Problem p02898 (python)

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

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

cnt=0

for h in H:
  if h>=K:
    cnt+=1
print(cnt)

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

H=list(input())

cnt=0

for h in H:
  if h>K:
    cnt+=1
print(cnt)

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

H=list(input())

cnt=0

for h in H:
  if h>K:
    cnt+=1
print(cnt)
Problem p02899 (python)

Fixed submission:
N=int(input())

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

B=[0]*N
for i in range(N):
  B[A[i]-1]=i+1

for i in range(N):
	print(B[i],end=" ")

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

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

B=[[0]*N]
for i in range(N):
  B[A[i]]=i+1

for i in range(N);
	print(B[i],end=" ")

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

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

B=[[0]*N]
for i in range(N):
  B[A[i]]=i

for i in range(N);
	print(B[i],end=" ")
Problem p02995 (python)

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

A,B,C,D=map(int,input().split())

c1=B//C
c2=(A-1)//C

cd1=B//((C*D)//gcd(C,D))
cd2=(A-1)//((C*D)//gcd(C,D))

d1=B//D
d2=(A-1)//D


print(str(int(B-A+1-(c1-c2)-(d1-d2)+(cd1-cd2))))

Buggy submission (verdict: Runtime Error):
  while b!=0:
    a,b=b,a%b
  return a

A,B,C,D=map(int,input().split())

c1=B//C
c2=(A-1)//C

cd1=B//((C*D)/gcd(C,D))
cd2=(A-1)//((C*D)/gcd(C,D))

d1=B//D
d2=(A-1)//D


print(int(B-A+1-(c1-c2)-(d1-d2)+(cd1-cd2)))

Buggy submission (verdict: Runtime Error):
import math

A,B,C,D=map(int,input().split())

c1=B//C
c2=(A-1)//C

cd1=B//((C*D)/math.gcd(C,D))
cd2=(A-1)//((C*D)/math.gcd(C,D))

d1=B//D
d2=(A-1)//D


print(int(B-A+1-(c1-c2)-(d1-d2)+(cd1-cd2)))
Problem p03030 (python)

Fixed submission:
N=int(input())

SP = [list(input().split()) for _ in range(N)]

sp=[]
count=1
for s,p in SP:
    sp.append([s,int(p),count])
    count+=1
    
#sp.sort(key=lambda x:x[1],reverse=True)
sp.sort(key=lambda x:(x[0],-x[1]))

for i,j,k in sp:
    print(k)

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

SP = [list(input().split()) for _ in range(N)]

sp=[]
count=1
for s,p in SP:
    sp.append([s,int(p),count])
    count+=1
    
#sp.sort(key=lambda x:x[1],reverse=True)
sp.sort(key=lambda x:(x[0],-x[1]))

for i in len(sp):
    print(sp[i][2])
Problem p03035 (python)

Fixed submission:

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

if A>=13:
    print(str(B))
elif A>=6 and A<13:
    print(str(int(B/2)))
else:
    print(str(0))

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


A=[int(i) for i in (input().split(" "))]

A.sort()

BC = [list(map(int,input().split())) for _ in range(M)]

BC.sort(key=lambda x:x[1],reverse=True)

for b,c in BC:
    A.expend([c]*b)
    if len(A)>2*N:
        break

A.sort(reverse=True)
suma=0
#for i in A:
#    suma+=i

print(sum(A[:N]))
Problem p03048 (python)

Fixed submission:
R,G,B,N=map(int,input().split())

ans=[]

count=0
for r in range(int(N/R)+1):
    for g in range(int((N-r*R)/G)+1):
        
        if (N-r*R-g*G)%B==0:
            count+=1
            #ans.append([r,g,(N-r*R-g*G)/B])

#print(ans)
print(count)

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

ans=[]

count=0
for r in range(int(N/R)+1):
    for g in range(int((N-r*R)/G)+1):
        
        if (N-r*R-g*G)%13B==0:
            count+=1
            #ans.append([r,g,(N-r*R-g*G)/B])

#print(ans)
print(count)

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

ans=[]

count=0
for r in range(int(N/R)+1):
    for g in range(int((N-r*R)/G)+1):
        
        if (N-r*R-g*G)%13B==0:
            count+=1
            #ans.append([r,g,(N-r*R-g*G)/B])

#print(ans)
print(count)

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

ans=[]

for r in range(int(N/R)+1):
    for g in range(int((N-r*R)/G)+1):
    	aaa=(N-r*R-g*G)/B)
        if aaa.is_integer():
            ans.append([r,g,aaa])

print(len(ans))

Buggy submission (verdict: Runtime Error):
13 1 4 3000
Problem p02865 (python)

Fixed submission:
import math
n = int(input())
ans = math.ceil(n/2) - 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = math.ceil(n/2)-1
print(ans)
Problem p02898 (python)

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

count = 0
for n in nums:
  if n >= k:
    count +=1
  else:
    continue
print(count)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
nums = []
for i in range(n):
    nums.append(int(input()))

count = 0
for n in nums:
  if n >= k:
    count +1
  else:
    continue
print(count)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
nums = []
for i in range(n):
    nums.append(int(input()))

count = 0
for n in nums:
  if n > k:
    count +1
  else:
    continue
print(count)
Problem p02947 (python)

Fixed submission:
N = int(input())
texts = []
for i in range(N):
    texts.append((input()))

import collections
counters = []
count = 0
for text in texts:
    text_list = list(text)
    text_list.sort()
    text = "".join(text_list) 
    c = collections.Counter(text)
    counters.append(c)



ccccc = []
anss = []
for ccc in counters:
    ccc = str(ccc)
    ccccc.append(ccc)
    

dd = collections.Counter(ccccc)
for v in dd.values():
    ans = v * (v-1) / 2
    anss.append(ans)
    
print(int(sum(anss)))

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

import collections
counters = []
count = 0
for text in texts:
    text_list = list(text)
    text_list.sort()
    text = "".join(text_list) 
    c = collections.Counter(text)
    counters.append(c)



ccccc = []
anss = 0
for ccc in counters:
    ccc = str(ccc)
    ccccc.append(ccc)
    

dd = collections.Counter(ccccc)
for v in dd.values():
    ans = v * (v-1) / 2
    anss.append(ans)
    
print(int(sum(anss)))
Problem p02994 (python)

Fixed submission:
apples =str(input())
apples_list = apples.split(" ")
N = int(apples_list[0])
L = int(apples_list[-1])
pai_values = []
 
for i in range(1,N+1):
    pai_value = i + L -1
    pai_values.append(pai_value)
    
min_pai = abs(pai_values[0])
target_number = 0
 
for j in range(N):
    if min_pai > abs(pai_values[j]):
        min_pai = abs(pai_values[j])
        target_number = j
        
pai_values.pop(target_number)
 
answer = sum(pai_values)
 
print(int(answer))

Buggy submission (verdict: Runtime Error):
apples =str(input())
apples_list = apples.split(" ")
N = int(apples_list[0])
L = int(apples_list[-1])
pai_values = []
 
for i in range(1,N+1):
    pai_value = i + L -1
    pai_values.append(pai_value)
    
min_pai = abs(pai_values[0])
 
for j in range(N):
    if min_pai > abs(pai_values[j]):
        min_pai = abs(pai_values[j])
        target_number = j
        
pai_values.pop(target_number)
 
answer = sum(pai_values)
 
print(int(answer))

Buggy submission (verdict: Runtime Error):
apples =str(input())
apples_list = apples.split(" ")
N = int(apples_list[0])
L = int(apples_list[-1])
pai_values = []

for i in range(1,N+1):
    pai_value = i + L -1
    pai_values.append(pai_value)

min_pai = abs(pai_values[0])

for j in range(N):
    if min_pai > abs(pai_values[j]):
        min_pai = abs(pai_values[j])
        target_number = j

pai_values.pop(target_number)

answer = sum(pai_values)

print(int(answer))

Buggy submission (verdict: Runtime Error):
apples =str(input())
apples_list = apples.split(" ")
N = int(apples_list[0])
L = int(apples_list[-1])
pai_values = []

for i in range(1,N+1):
    pai_value = i + L -1
    pai_values.append(pai_value)

min_pai = abs(pai_values[0])

for j in range(N):
    if min_pai > abs(pai_values[j]):
        min_pai = abs(pai_values[j])
        target_number = j

pai_values.pop(target_number)

print(sum(pai_values))
Problem p02995 (python)

Fixed submission:
import fractions

A,B,C,D = map(int, input().split())
lcm_number = C*D // fractions.gcd(C, D)
all_number = B -A + 1

answer_C = B // C - (A-1) // C
answer_D = B // D - (A-1) // D
answer_lcm = B // lcm_number - (A-1) // lcm_number

print(all_number - answer_C - answer_D + answer_lcm)

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

lcm_number = C*D // math.gcd(C, D)
all_number = B -A + 1

answer_C = B // C - (A-1) // C
answer_D = B // D - (A-1) // D
answer_lcm = B // lcm_number - (A-1) // lcm_number

print(all_number - answer_C - answer_D + answer_lcm)

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())
lcm_number = C*D // math.gcd(C, D)  #最小公倍数
all_number = B -A + 1

answer_C = B // C - (A-1) // C
answer_D = B // D - (A-1) // D
answer_lcm = B // lcm_number - (A-1) // lcm_number

print(all_number - answer_C - answer_D + answer_lcm)

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


number =str(input())
numbers = number.split(" ")
A = int(numbers[0])
B = int(numbers[1])
C = int(numbers[2])
D = int(numbers[3])

number = B - A + 1

answer_C = number // C

answer_D = number // D

answer_E = number // lcm(C,D)
final_answer = number - answer_C - answer_D + answer_E
final_answer = int(final_answer)
print(final_answer)

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


number =str(input())
numbers = number.split(" ")
A = int(numbers[0])
B = int(numbers[1])
C = int(numbers[2])
D = int(numbers[3])

number = B - A + 1

answer_C = number // C

answer_D = number // D

answer_E = number // lcm(C,D)
final_answer = number - answer_C - answer_D + answer_E
print(int(final_answer))

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)


number =str(input())
numbers = number.split(" ")
A = int(numbers[0])
B = int(numbers[1])
C = int(numbers[2])
D = int(numbers[3])

number = B - A + 1

answer_C = number / C

answer_D = number / D

answer_E = number / lcm(C,D)
final_answer = number - answer_C - answer_D + answer_E
print(int(final_answer))
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())

ans = 1
count = 0

if len(S) == 1:
    ans = S[0]
else:
    for i in S:
        if i == "1":
            count += 1
        if not i == "1":
            if K > count:
                ans = i
                break
            else:
                ans = 1
print(ans)

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

if len(S) == 1:
    ans = S[0]
else:
    for i in S:
        if not i == "1":
            ans = i
            break
print(ans)
Problem p03471 (python)

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

import sys

for i in range(n+1):
    for j in range(n+1-i):
        k = n - i - j
        if 10000 * i + 5000 * j + 1000 * k == y:
            print(i,j,k)
            sys.exit()

print(-1, -1, -1)

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

import sys
flag = False
for i in range(n):
    for j in range(n-j):
        k = n - i - j
        if 10000 * i + 5000 * j + 1000 * k == y:
            flag = True
            print(i,j,k)
            sys.exit()
if flag == False:
    print(-1, -1, -1)
Problem p02921 (python)

Fixed submission:
S = input()
T = input()
ans = 0
for i in range(3):
    if T[i] == S[i]:
        ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
ans = 1
c = a-1
while a < b:
  a += c
  ans += 1
print(ans)
Problem p02934 (python)

Fixed submission:
N = int(input())
Lists = map(int,input().split())
sum = 0
for x in Lists:
  sum+=1/x
 
print(1/sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
Lists = map(int,input().split())
sum = 0
for x in Lists:
  sum+=i/x
 
print(1/sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
Lists = map(int,input().split())
sum = 0
for x in Lists:
  sum+=i/x
 
print(i/sum)
Problem p02988 (python)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
ans = 0
for x in range(n-2):
  for y in range(x+1,x+2):
    for z in range(x+2,x+3):
      if p[x] >= p[y] and p[y] >= p[z]:
        ans+=1
      elif p[z] >= p[y] and p[y] >= p[x]:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
for x in range(N-2):
  for y in range(x+1,x+1):
    for z in range(x+2,x+2):
Problem p02993 (python)

Fixed submission:
s = input()
if s[0] == s[1]:
  print('Bad')
elif s[2] == s[1]:
  print('Bad')
elif s[3] == s[2]:
  print('Bad')
else:
  print('Good')

Buggy submission (verdict: Runtime Error):
S = input()
if s[0] == s[1]:
  print(Bad)
elif s[2] == s[1]:
  print(Bad)
elif s[3] == s[2]:
  print(Bab)
else:
  print(Good)

Buggy submission (verdict: Runtime Error):
S = input()
if s[0] == s[1] and s[2] == s[1] and s[3] == s[2]:
  print(Bad)
else:
  print(Good)
Problem p03029 (python)

Fixed submission:
A,B =map(int,input().split())
goukei=3*A+B
print(int(goukei/2))

Buggy submission (verdict: Runtime Error):
A,B map(int,input().split())
goukei=3*A+B
print(int(goukei/2))
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())
print('Yes' if int(N % 500) <= A else 'No')

Buggy submission (verdict: Runtime Error):
%import numpy as np
c1 = [int(i) for i in input().split()]
c2 = [int(i) for i in input().split()]
c3 = [int(i) for i in input().split()]
s = sum(c1) + sum(c2) + sum(c3)
print('Yes' if s % 3 == 0 else 'No')
Problem p03435 (python)

Fixed submission:
import numpy as np
c = np.array([[int(i) for i in input().split()] for _ in range(3)])
b = np.sum(c) % 3 == 0
b &= np.sum(c[0] - c[1]) % 3 == 0
b &= np.sum(c[0] - c[2]) % 3 == 0
b &= np.sum(c[1] - c[2]) % 3 == 0
c = c.T
b &= np.sum(c[0] - c[1]) % 3 == 0
b &= np.sum(c[0] - c[2]) % 3 == 0
b &= np.sum(c[1] - c[2]) % 3 == 0
print('Yes' if b else 'No')

Buggy submission (verdict: Runtime Error):
%import numpy as np
c1 = [int(i) for i in input().split()]
c2 = [int(i) for i in input().split()]
c3 = [int(i) for i in input().split()]
s = sum(c1) + sum(c2) + sum(c3)
print('Yes' if s % 3 == 0 else 'No')

Buggy submission (verdict: Runtime Error):
%import numpy as np
c1 = [int(i) for i in input().split()]
c2 = [int(i) for i in input().split()]
c3 = [int(i) for i in input().split()]
s = sum(c1) + sum(c2) + sum(c3)
print(s % 3 == 0)
Problem p03493 (python)

Fixed submission:
num = list(input())

count = 0
for i in num:
  if i == '1':
    count += 1
print(count)

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

count = 0
for i in a:
  c = 0
  while i != 0 and i % 2 == 0:
    i /= 2
    c += 1
  if c >= count:
    count = c
print(count)
Problem p03494 (python)

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

carray = []
for i in a:
  c = 0
  while i != 0 and i % 2 == 0:
    i /= 2
    c += 1
  carray.append(c)
print(min(carray))

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

count = 0
for i in a:
  c = 0
  while i != 0 and i % 2 == 0:
    i /= 2
    c += 1
  if c <= count or count = 0:
    count = c
print(count)
Problem p03545 (python)

Fixed submission:
a, b, c, d = map(int, list(input()))
if a+b+c+d == 7: print(a,"+", b, "+", c, "+", d, "=7", sep="")
elif a+b+c-d == 7: print(a,"+", b, "+", c, "-", d, "=7", sep="")
elif a+b-c+d == 7: print(a,"+", b, "-", c, "+", d, "=7", sep="")
elif a-b+c+d == 7: print(a,"-", b, "+", c, "+", d, "=7", sep="")
elif a+b-c-d == 7: print(a,"+", b, "-", c, "-", d, "=7", sep="")
elif a-b-c+d == 7: print(a,"-", b, "-", c, "+", d, "=7", sep="")
elif a-b+c-d == 7: print(a,"-", b, "+", c, "-", d, "=7", sep="")
else: print(a,"-", b, "-", c, "-", d, "=7", sep="")

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, list(input()))
if a+b+c+d == 7: print(a,"+", b, "+", c, "+", d, sep="")
elif a+b+c-d == 7: print(a,"+", b, "+", c, "-", d, sep="")
elif a+b-c+d == 7: print(a,"+", b, "-", c, "+", d, sep="")
elif a-b+c+d == 7: print(a,"-", b, "+", c, "+", d, sep="")
elif a+b-c-d == 7: print(a,"+", b, "-", c, "-", d, sep="")
elif a-b-c+d == 7: print(a,"-", b, "-", c, "+", d, sep="")
elif a-b+c-d == 7: print(a,"-", b, "+", c, "-", d, sep="")
else: print(a,"-", b, "-", c, "-", d, sep="")1222
Problem p03730 (python)

Fixed submission:
import fractions, sys
a, b, c = map(int, input().split())
for i in [x*a for x in range(1, a*b//fractions.gcd(a,b)+1)]:
    if i % b == c:
        print("YES")
        sys.exit()
print("NO")

Buggy submission (verdict: Runtime Error):
import math
import sys
a, b, c = map(int, input().split())
lcm = (a * b)//(math.gcd(a,b))
for i in [x*a for x in range(1, lcm+1)]:
    if i % b == c:
        print("YES")
        sys.exit()
print("NO")

Buggy submission (verdict: Runtime Error):
import math
import sys
a, b, c = map(int, input().split())
lcm = a*b//math.gcd(a,b)
for i in [x*a for x in range(1, lcm+1)]:
    if i % b == c:
        print("YES")
        sys.exit()
print("NO")

Buggy submission (verdict: Runtime Error):
import math, sys
a, b, c = map(int, input().split())
for i in [x*a for x in range(1, a*b//math.gcd(a,b))]:
    if i % b == c:
        print("YES")
        sys.exit()
print("NO")
Problem p03854 (python)

Fixed submission:
s = input()
while(1):
    if s.endswith('dream'):
        s = s[:-5]
    elif s.endswith('dreamer'):
        s = s[:-7]
    elif s.endswith('eraser'):
        s = s[:-6]
    elif s.endswith('erase'):
        s = s[:-5]
    else:
        print("NO")
        quit()
    if s == '':
        break
print("YES")

Buggy submission (verdict: Runtime Error):
s = input()
while(1):
    print(s)
    if s.endswith('dream'):
        s = s[:-5]
    elif s.endswith('dreamer'):
        s = s[:-7]
    elif s.endswith('eraser'):
        s = s[:-6]
    elif s.endswith('erase'):
        s = s[:-5]
    else:
        print("NO")
        quit()
    if s == '':
        break
print("YES")
Problem p03076 (python)

Fixed submission:
A = [int(input()) for i in range(5)]
B = [A[i] % 10 for i in range(5)]
C = [10 - B[i] for i in range(5) if B[i] != 0]
if C == []:
    C.append(0)

ans = 0
for i in range(5):
    ans += A[i]
    if B[i]: ans += 10 - B[i]

print(ans - max(C))

Buggy submission (verdict: Runtime Error):
A = [int(input()) for i in range(5)]
B = [A[i] % 10 for i in range(5)]
C = [10 - B[i] for i in range(5) if B[i] != 0]

ans = 0
for i in range(5):
    ans += A[i]
    if B[i]: ans += 10 - B[i]

print(ans - max(C))
Problem p03095 (python)

Fixed submission:
n = int(input())
s = input()
s_set = set(s)
S = []
for i in s_set:
    S.append(s.count(i))

ans = 1
for i in S:
    ans *= i + 1
    ans %= 10 ** 9 + 7

print(ans - 1)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)

n = int(input())
s = input()
s_set = set(s)
S = []
for i in s_set:
    S.append(s.count(i))

def cal(n, S):
    if n == 1:
        return sum(S)
    ans = 0
    if n == 2:
        for i in range(len(S) - 1):
            for j in range(i+1, len(S)):
                ans += S[i] * S[j]
    else:
        for i in range(len(S) - n + 1):
            cross = cal(n-1, S[i+1:])
            cross %= 10 ** 9 + 7
            ans += S[i] * cross
            ans %= 10 ** 9 +7
        return ans % 10 ** 9 + 7

ans = 0
for i in range(n):
    ans += cal(i+1, S)

ans %= 10 ** 9 + 7
print(ans)