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

Fixed submission:
n=int(input())
INF=float('inf')

h=[]
for _ in range(n):
  a,b,c=map(int,input().split())
  h.append([a,b,c])

dp=[[0 for i in range(3)]for j in range(n+1)]
for i in range(1,n+1):
  dp[i][0]=max(dp[i-1][1]+h[i-1][0],dp[i-1][2]+h[i-1][0])
  dp[i][1]=max(dp[i-1][0]+h[i-1][1],dp[i-1][2]+h[i-1][1])
  dp[i][2]=max(dp[i-1][0]+h[i-1][2],dp[i-1][1]+h[i-1][2])

print(max(dp[n][0],dp[n][1],dp[n][2]))

Buggy submission (verdict: Runtime Error):
n=int(input())
INF=float('inf')

h=[]
for _ in range(n):
  a,b,c=map(int,input().split())
  h.append([a,b,c])

dp=[[0 for i in range(3)]for j in range(n+1)]
for i in range(1,n+1):
  dp[i][0]=max(dp[i-1][1]+h[i-1][0],dp[i-1][2]+h[i-1[0]])
  dp[i][1]=max(dp[i-1][0]+h[i-1][1],dp[i-1][2]+h[i-1[1]])
  dp[i][2]=max(dp[i-1][0]+h[i-1][2],dp[i-1][1]+h[i-1[2]])

print(max(dp[n][0],dp[n][1],dp[n][2]))

Buggy submission (verdict: Runtime Error):
n=int(input())
INF=float('inf')

h=[]
for _ in range(n):
  a,b,c=map(int,input().split())
  h.append(a,b,c)

dp=[[0 for i in range(3)]for j in range(n+1)]
for i in range(1,n+1):
  dp[i][0]=max(dp[i-1][1]+h[i-1][0],dp[i-1][2]+h[i-1[0]])
  dp[i][1]=max(dp[i-1][0]+h[i-1][1],dp[i-1][2]+h[i-1[1]])
  dp[i][2]=max(dp[i-1][0]+h[i-1][2],dp[i-1][1]+h[i-1[2]])

print(max(dp[n][0],dp[n][1],dp[n][2]))
Problem p03163 (python)

Fixed submission:
n,w=map(int,input().split())
P=[]
for _ in range(n):
  iw,iv=map(int,input().split())
  P.append([iw,iv])
INF=float('inf')
 
dp=[[0 for i in range(w+1)] for j in range(n+1)]
 
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-P[i-1][0]>=0:
      dp[i][j]=max(dp[i-1][j],dp[i-1][j-P[i-1][0]]+P[i-1][1])
    else:
      dp[i][j]=dp[i-1][j]
print(dp[n][w])

Buggy submission (verdict: Runtime Error):
n,w = map(int,input().split())
wv=[]
for _ in range(n):
  w,v=map(int,input().split())
  wv.append([w,v])

dp=[[0 for i in range(w+1)]for j in range(n+1)]
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-wv[i-1][0]<0:
      dp[i][j]=dp[i-1][j]
    else:
      dp[i][j]=max(dp[i-1][j-wv[i][1]],dp[i-1][j])

print(dp[n][w])

Buggy submission (verdict: Runtime Error):
n,w = map(int,input().split())
wv=[]
for _ in range(n):
  w,v=map(int,input().split())
  wv.append([w,v])

dp=[[0 for i in range(w+1)]for j in range(n+1)]
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-wv[i-1][0]<0:
      dp[i][j]=dp[i-1][j]
    else:
      dp[i][j]=max(dp[i-1][j-wv[i][0]],dp[i-1][j])

print(dp[n][w])

Buggy submission (verdict: Runtime Error):
n,w = map(int,input().split())
wv=[]
for _ in range(n):
  w,v=map(int,input().split())
  wv.append([w,v])

dp=[[0 for i in range(w+1)]for j in range(n+1)]
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-h[i]<0:
      dp[i][j]=dp[i-1][j]
    else:
      dp[i][j]=max(dp[i-1][j-wv[i][0]],dp[i-1][j])

print(dp[n][w])

Buggy submission (verdict: Runtime Error):
n,w = map(int,input().split())
wv=[]
for _ in range(n):
  w,v=map(int,input().split())
  wv.append([w,v])

dp=[[0 for i in range(w+1)]for j in range(n+1)]
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-h[i]<0:
      dp[i][w]=dp[i-1][w]
    else:
      dp[i][w]=max(dp[i-1][w-wv[i][0]],dp[i-1][w])

print(dp[n][w])

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

dp=[[0 for i in range(w+1)]for j in range(n+1)]
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-h[i]<0:
      dp[i][w]=dp[i-1][w]
    else:
      dp[i][w]=max(dp[i-1][w-wv[i][0]],dp[i-1][w])

print(dp[n][w])
Problem p02645 (python)

Fixed submission:
s = input()
print(s[0] + s[1] + s[2])

Buggy submission (verdict: Runtime Error):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = input()

move_a = int(v) * int(t) + int(a)
move_b = int(w) * int(t) + int(b)

if move_a >= move_b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
# coding:utf-8
a,v = map(int,input().split())
b,w = map(int,input().split())
t = input()
 
move_a = int(v) * int(t) + int(a)
move_b = int(w) * int(t) + int(b)
 
if move_a >= move_b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = input()

move_a = int(v) * int(t) + int(a)
move_b = int(w) * int(t) + int(b)

if move_a >= move_b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,v = input().split()
b,w = input().split()
t = input()
 
move_a = int(v) * int(t) + int(a)
move_b = int(w) * int(t) + int(b)
 
if move_a >= move_b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
# coding:utf-8
a,v = input().split()
b,w = input().split()
t = input()

move_a = int(v) * int(t) + int(a)
move_b = int(w) * int(t) + int(b)

if move_a >= move_b:
    print("YES")
else:
    print("NO")
Problem p02657 (python)

Fixed submission:
a,b = input().split()
print(int(a) * int(b))

Buggy submission (verdict: Runtime Error):
n = input()
answer = 1
for i in range(int(n)):
    a = int(input())
    answer = answer * a
    if answer > 10**18:
        print("-1")
        break
print(answer)

Buggy submission (verdict: Runtime Error):
n = input()
answer = 1
for i in range(int(n)):
    a = int(input())
    answer = answer * a
    if answer > 10**18:
        print("-1")
    else:
        print(answer)

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

n = input()
answer = 1
for i in range(int(n)):
    a = int(input())
    answer = answer * a
    if answer > 10**18:
        print("-1")
    else:
        print(answer)

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(n-1):
    a = raw_input().split()
    n *= 1
    print(n)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

print(a * b)
Problem p02576 (python)

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

count = 0
while(N>0):
  N = N - X
  count += 1
  
print(T*count)

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

c = N % 9
if(c==0):
  print("Yes")
else:
  print("No")
Problem p02582 (python)

Fixed submission:
a,b,c = map(str,input().rstrip(""))


if(a=="R" and b == "R" and c == "R"):
  count = 3
  
elif(a=="R" and b == "R" and c == "S"):
  count = 2
elif(a=="R" and b == "S" and c == "S"):
  count = 1
elif(a=="S" and b == "R" and c == "R"):
  count = 2
elif(a=="S" and b == "R" and c == "S"):
  count = 1
elif(a=="S" and b == "S" and c == "R"):
  count = 1
elif(a=="R" and b == "S" and c == "R"):
  count = 1
else:
  count = 0

print(count)

Buggy submission (verdict: Runtime Error):
import itertools

X,K,D = map(int,input().split())
L = [D,-D]

for comb in itertools.combinations_with_replacement(L, K):
  x = X
  for d in comb:
    x = x + d
    if(i == 0):
      x_min = x
    if(abs(x) < abs(x_min)):
      x_min = x

print(abs(x_min))

Buggy submission (verdict: Runtime Error):
import itertools

X,K,D = map(int,input().split())
L = [D,-D]
comb = list(itertools.combinations_with_replacement(L, K))

for i in range(len(comb)):
  x = X
  for d in comb[i]:
    x = x + d
    if(i == 0):
      x_min = x
    if(abs(x) < abs(x_min)):
      x_min = x

print(abs(x_min))
Problem p02639 (python)

Fixed submission:
A,B,C,D,E=map(int,input().split())

if A == 0:
    print(1)
elif B == 0:
    print(2)
elif C == 0:
    print(3)
elif D == 0:
    print(4)
else:
    print(5)

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split())

a = 2*X -Y/2
b = Y/2 - X

if ((a+b) == X) and ((2*a+4*b) == Y):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split())

a = 2*X -Y/2
b = Y/2 - X

if (a+b) == X:
    pass 
    if (2*a+4*b) == Y:
        print('Yes')
    else:
        print('No')
else:
    print('No')

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

if A = 0:
    print(1)
elif B = 0:
    print(2)
elif C = 0:
    print(3)
elif D = 0:
    print(4)
else:
    print(5)

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

if A = 0:
    print(1)
elif B = 0:
    print(2)
elif C = 0:
    print(3)
elif D = 0:
    print(4)
else E = 0:
    print(5)
break

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

if A = 0:
    print(1)
elif B = 0:
    print(2)
elif C = 0:
    print(3)
elif D = 0:
    print(4)
else E = 0:
    print(5)

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

    if A == 0:
        print(1)
    elif B == 0:
        print(2)
    elif C == 0:
        print(3)
    elif D == 0:
        print(4)
    else E == 0:
        print(5)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E=map(int,input().split())
a=A
b=B
c=C
d=D
    if a == 0:
        print(1)
    elif b == 0:
        print(2)
    elif c == 0:
        print(3)
    elif d == 0:
        print(4)
    else e == 0:
        print(5)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E=map(int,input().split())
if A == 0:
  print(1)
elif B == 0:
  print(2)
elif C == 0:
  print(3)
elif D == 0:
  print(4)
else E == 0:
  print(5)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E=map(int,input().split())
    if A == 0:
    print(1)
    elif B == 0:
    print(2)
    elif C == 0:
    print(3)
    elif D == 0:
    print(4)
    else E == 0:
    print(5)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E=map(int,input().split())
    if A == 0:
        print('1')
    elif B == 0:
        print('2')
    elif C == 0:
        print('3')
    elif D == 0:
        print('4')
    else E == 0:
        print('5')

Buggy submission (verdict: Runtime Error):
A,B,C,D,E=map(int,input().split())
if A == 0:
    print(1)
elif B == 0:
    print(2)
elif C == 0:
    print(3)
elif D == 0:
    print(4)
else E == 0:
    print(5)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E=map(int,input().split())
    if A =0:
        print(1)
    elif B = 0:
        print(2)
    elif C = 0:
        print(3)
    elif D = 0:
        print(4)
    else E = 0:
        print(5)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E=map(int,input().split())
    if A == 0:
        print(1)
    elif B == 0:
        print(2)
    elif C == 0:
        print(3)
    elif D == 0:
        print(4)
    else E == 0:
        print(5)
Problem p02681 (python)

Fixed submission:
S=input()
T=input()

lenS=len(S)
T2=T[0:lenS]

if S == T2:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=int(input("Sを入力してください"))
T=int(input("Tを入力してください"))

v='a' or 'b' or 'c' or 'd' or 'e' or 'f' or 'g' or 'i' or 'j' or 'k' or 'l' or 'm' or 'n' or 'o' or 'p' or 'q' or 'r' or 's' or 't' or 'u' or 'v' or 'w' or 'x' or 'y' or 'z'

if S =((v + v + v + v + v + v + v + v + v + v) or (v + v + v + v + v + v + v + v + v) or (v + v + v + v + v + v + v + v ) or (v + v + v + v + v + v + v ) or (v + v + v + v + v + v )or (v + v + v + v + v ) or (v + v + v + v )  or (v + v + v )  or (v + v )  or (v )  
       pass
if S =( T + v ):
  print("YES")
else:
  print("No")
Problem p02687 (python)

Fixed submission:
S=input()

if S == "ABC":
  print("ARC")
else:
  print("ABC")

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

if S = "ABC":
  print("ARC")
else:
  print("ABC")
Problem p02705 (python)

Fixed submission:
R=int(input())
pai=3.14
print(R*2*pai)

Buggy submission (verdict: Runtime Error):
R=int(input())
pai=3.14
    print(R*2*pai)

Buggy submission (verdict: Runtime Error):
R=int(input())
pai=float(3.14)
    print(float(R*2*pai))

Buggy submission (verdict: Runtime Error):
R=int(input())
    print(float(R*2*3.141))

Buggy submission (verdict: Runtime Error):
R=int(input())
    print(R*2*3.141)

Buggy submission (verdict: Runtime Error):
R=int(input())
    print(R*3.141)

Buggy submission (verdict: Runtime Error):
R=int(input())
pai=float(3.141)
    print(R*pai)

Buggy submission (verdict: Runtime Error):
R=int(input())
    print(R*2*3.141)
Problem p02717 (python)

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

print (C,A,B)

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

print ((C,A,B).split())

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

print ((C,A,B).split=())

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

print (int(C,A,B).split=())

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

print (int(C,A,B).split)

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

print (map(int(C,A,B).split))

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

A=N[0]
B=N[1]
C=N[2]

print (C,A,B)
Problem p03087 (python)

Fixed submission:
#!/usr/bin/env python3
# n,m = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(sys.stdin.readline() for _ in range(n)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# n = int(sys.stdin.readline())
# INF = float("inf")
import sys,collections
N,Q = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
S = sys.stdin.readline().rstrip()
se = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(Q)) # multi line with multi param

INF = float("inf")
com = [0]*(N+1)

for i in range(N):
    com[i+1] = com[i]
    if S[i] == "A" and S[min(i+1,N-1)] == "C":
        com[i+1] += 1

for s,e in se:
    print(com[e-1] - com[s-1])

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# n,m = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(sys.stdin.readline() for _ in range(n)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# n = int(sys.stdin.readline())
# INF = float("inf")
import sys,collections
N,Q = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
S = sys.stdin.readline().rstrip()
se = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(Q)) # multi line with multi param

INF = float("inf")
com = [0]*(N+1)

for i in range(N):
    com[i+1] = com[i]
    if S[i] == "A" and S[i+1] == "C":
        com[i+1] += 1

for s,e in se:
    print(com[e-1] - com[s-1])
Problem p03308 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
maxi = 0
mini = float("inf")
for n in A:
  maxi = max(maxi,n)
  mini = min(mini,n)
print(maxi-mini)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = map(int,input())
maxi = 0
for i in range(N-1):
  maxi = max(maxi,A[i]-A[i+1])
print(maxi)
Problem p03331 (python)

Fixed submission:
N = int(input())
mini = float("inf")
for A in range(1,N-1+1):
  mini = min(mini,sum([int(digit) for digit in str(A)])+sum([int(digit) for digit in str(N-A)]))
print(mini)

Buggy submission (verdict: Runtime Error):
A = list(map(int,input().split()))
A.sort()
ret = 0
ret += A[2]-A[1]
A[1] += ret
A[0] += ret
ret += (A[1]-A[0])//2
if (A[1]-A[0])%2==1:
  ret += 2
print(ret)
Problem p03434 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
a = map(int, input().split())
a.sort()
print(sum(a[0::2])-sum(a[1::2]))
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ret = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if 500*a+100*b+50*c == X:
        ret += 1
print(ret)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ret = 0
for a in range(A):
  for b in range(B):
    for c in range(C):
      if 500*a+100*b+50*c = X:
        ret += 1
print(ret)
Problem p03470 (python)

Fixed submission:
N = int(input())
a = set()
for i in range(N):
  a.add(int(input()))
print(len(a))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = set()
for i in range(N):
  set.add(int(input()))
print(len(a))
Problem p03486 (python)

Fixed submission:
s = sorted(input())
t = sorted(input(),reverse=True)
if s<t:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = sorted(int(input()))
t = sorted(int(input()),reverse=True)
if s<t:
  print("Yes")
else:
  print("No")
Problem p03504 (python)

Fixed submission:
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys

N,C = map(int,sys.stdin.readline().split())
stc = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
M = 10**5
imos=[[0]*(M+1) for _ in range(C+1)]

for s,t,c in stc:
    imos[c][s] += 1
    if t+1 < M+1:
        imos[c][t+1] -= 1

#print(imos)
s = set()
ret = 0
for i in range(M):
    for c in range(C+1):
        imos[c][i+1] += imos[c][i]
    ret = max(ret,sum(min(1,imos[c][i+1]) for c in range(C+1)))
#print(imos)
print(ret)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys

N,C = map(int,sys.stdin.readline().split())
stc = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
M = 10**5
imos_s=[set() for _ in range(M+1)]
imos_e=[set() for _ in range(M+1)]

for s,t,c in stc:
    imos_s[s].add(c)
    imos_e[t+1].add(c)

#print(imos_s)
#print(imos_e)
s = set()
imos=[set()]*(M+1)
ret = 0
for i in range(M):
    imos[i+1] = (imos[i]-imos_e[i])|(imos_s[i])
    ret = max(ret,len(imos[i+1]))
#print(imos)
print(ret)
Problem p03599 (python)

Fixed submission:
A,B,C,D,E,F = map(int,input().split())
m_d = 0
m_t = 100*A
m_s = 0
for a in range(F//100*A+1):
  for b in range((F-100*A*a)//(100*B)+1):
    for c in range((F-A*a*100-B*b*100)//C+1):
      d = 0
      while (100*A*a+100*B*b) > 0 and 100*A*a+100*B*b+C*c+D*d <= F and (C*c+D*d)/(100*A*a+100*B*b) <= E/100:
        dens = (C*c+D*d)/(100*A*a+100*B*b)
        if dens == E/100:
          print(100*A*a+100*B*b+C*c+D*d,C*c+D*d)
          exit()
        elif m_d < dens:
          m_d = dens
          m_t = 100*A*a+100*B*b+C*c+D*d
          m_s = C*c+D*d
        d += 1
print(m_t,m_s)

Buggy submission (verdict: Runtime Error):
m_t = 0
m_s = 0
for a in range(F//100*A+1):
  for b in range((F-100*A*a)//(B)+1):
    for c in range((F-A*a*100-B*b*100)//C+1):
      d = 0
      while (100*A*a+100*B*b) > 0 and 100*A*a+100*B*b+C*c+D*d < F and (C*c+D*d)/(100*A*a+100*B*b) <= E/100:
        dens = (C*c+D*d)/(100*A*a+100*B*b)
        if (C*c+D*d)/(100*A*a+100*B*b) == E/100:
          print(100*A*a+100*B*b+C*c+D*d,C*c+D*d)
          exit()
        elif m_d < dens:
          m_d = dens
          m_t = 100*A*a+100*B*b+C*c+D*d
          m_s = C*c+D*d
        d += 1
print(m_t,m_s)
Problem p03624 (python)

Fixed submission:
s = input()
b = [0]*26
for c in s:
  b[ord(c)-ord("a")]+=1
for i,c in enumerate(b):
  if c == 0:
    print(chr(i+ord("a")))
    exit()
print("None")

Buggy submission (verdict: Runtime Error):
s = input()
b = [0]*25
for c in s:
  b[ord(c)-ord("a")]+=1
for i,c in enumerate(b):
  if c == 0:
    print(chr(i+ord("a")))
    exit()
print("None")
Problem p03730 (python)

Fixed submission:
import fractions
A,B,C=map(int,input().split())
lcm = A*B#//fractions.gcd(A,B)
#A*(i+j)%B=C
#A*(i+j)=BX+C
i=A
while i<=lcm:
  #print(i,lcm)
  if i%B==C:
    print("YES")
    exit()
  i+=A
print("NO")

Buggy submission (verdict: Runtime Error):
import math
A,B,C=map(int,input().split())
lcm = A*B//math.gcd(A,B)
#A*(i+j)%B=C
#A*(i+j)=BX+C
i=A
while i<=lcm:
  if i%B==C:
    print("YES")
    exit()
  i*=A
print("NO")
Problem p03814 (python)

Fixed submission:
s=input()
ia=None
iz=None
for i,c in enumerate(s):
  if ia==None and c=="A":
    ia=i
  if c=="Z":
    iz=i
print(iz-ia+1)

Buggy submission (verdict: Runtime Error):
s=input()
ia=None
iz=None
for i,c in s:
  if ia==None and c=="a":
    ia=i
  if c=="z":
    iz=i
print(iz-ia+1)
Problem p03854 (python)

Fixed submission:
S0 = input()
S = S0[::-1]
cands = ["dream"[::-1],"dreamer"[::-1],"erase"[::-1],"eraser"[::-1]]
i = 0
while i < len(S):
  f = False
  for word in cands:
    #print(S[i:],word)
    if S[i:].startswith(word):
        f = True
        i += len(word)
        break
  if f == False:
    print("NO")
    exit(0)
#print(i)
if i == len(S):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
S0 = input()
S = S0[::-1]
cands = ["dream"[::-1],"dreamer"[::-1],"erase"[::-1],"eraser"[::-1]]
i = 0
while i < len(S):
  f = False
  for word in cands:
    #print(S[i:],word)
    if S[i:].startswith(word):
        f = True
    	i += len(word)
    	break
  if f = False:
    print("NO")
    exit(0)
#print(i)
if i == len(S):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
S.reverse()
cands = map(reverse,["dream","dreamer","erase","eraser"])
i = 0
while i < len(S):
  for word in cands:
	S[i:].startsWith(word)
    i += len(word)
if i == len(S):
  return True
return False
Problem p03944 (python)

Fixed submission:
W,H,N = map(int,input().split())
c = [0]*N
max_x,min_x = 0,W
max_y,min_y = 0,H
for _ in range(N):
  x,y,a = map(int,input().split())
  if a == 1:
    max_x = max(max_x,x)
  elif a == 2:
    min_x = min(min_x,x)
  elif a == 3:
    max_y = max(max_y,y)
  else:
    min_y = min(min_y,y)
  if min_x <= max_x or min_y <= max_y:
      print(0)
      exit()
print((min_x-max_x)*(min_y-max_y))

Buggy submission (verdict: Runtime Error):
W,H,N = map(int,input().split())
c = [0]*N
max_x,min_x = 0,W
max_y,min_y = 0,H
for _ in range(M):
  x,y,a = map(int,input().split())
  if a == 1:
    max_x = max(max_x,x)
  elif a == 2:
    min_x = min(min_x,x)
  elif a == 3:
    max_y = max(max_y,y)
  else:
    min_y = min(min_y,y)
  if min_x <= max_x or min_y <= max_y:
      print(0)
      exit()
print((min_x-max_x)*(min_y-max_y))
Problem p02687 (python)

Fixed submission:
input_line = input()

if (input_line == "ABC"):
  print("ARC")
else:
  print("ABC")

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

if (input_line == "ABC"):
  print("ARC")
else:
  print("ABC")
Problem p02952 (python)

Fixed submission:
N = int(input())
ans = 0
 
for i in range(1, N + 1):
  if (len(str(i)) % 2 == 1):
      ans += 1
  else:
      continue
print(ans)

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

for i in range(1, N + 1):
  if (len(str(i) % 2 == 1):
      ans += 1
  else:
      continue

print(ans)
Problem p03105 (python)

Fixed submission:
a, b, c = map(int, input().split())
 
if a <= b:
  x = b // a
  if x >= c:
    print(c)
  else:
    print(x)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a, b c = map(int, input().split())
 
if a <= b:
  x = b // a
  if x >= c:
    print(c)
  else:
    print(x)
else:
  print(0)

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

if a >= b:
  x = a // b
  if x >= c:
    print(c)
  else:
    print(x)
else:
  print(0)
Problem p03211 (python)

Fixed submission:
data = [int(i) for i in input()]
ans = 999
 
for i in range(len(data) - 2):
  x = (data[i] * 100) + (data[i + 1] * 10) + (data[i + 2])
  ans = min(ans, abs(753 - x))
  
print(ans)

Buggy submission (verdict: Runtime Error):
data = list(input())
tera = []
ans = 999
for i in len(data) - 3:
  x = int(data[i] + data[i + 1] + data[i + 2])
  ans = min(ans, abs(ans - x))
print(ans)