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

Fixed submission:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math

N,D = map(int, sys.stdin.readline().rstrip().split())
ds = list(map(int, sys.stdin.readline().rstrip().split()))
Q, = map(int, sys.stdin.readline().rstrip().split())
qs = list(map(int, sys.stdin.readline().rstrip().split()))


targets = [1]
for d in reversed(ds):
    if(d//2 < targets[-1]):
        targets.append(targets[-1] + d)
    else:
        targets.append(targets[-1])
targets.reverse()

current = D
can_avoids = []
for i in range(N):
    d = ds[i]
    target = targets[i+1]
    #print("current:", current)
    can_avoids.append(current >= target)
    if d//2 < current:
        current -= d
        current = max(-current, current)

#print(targets)
#print(can_avoids)

for q in qs:
    if (can_avoids[q-1]):
        print("YES")
    else:
        print("NO")


exit(0)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math

N,D = map(int, sys.stdin.readline().rstrip().split())
ds = map(int, sys.stdin.readline().rstrip().split())
Q, = map(int, sys.stdin.readline().rstrip().split())
qs = map(int, sys.stdin.readline().rstrip().split())
qs.sort()


targets = [1]
for d in reversed(ds):
    if(d//2 < targets[-1]):
        targets.append(targets[-1] + d)
    else:
        targets.append(targets[-1])
targets.reverse()

current = D
can_avoids = []
for i in range(N):
    d = ds[i]
    target = targets[i+1]
    #print("current:", current)
    can_avoids.append(current >= target)
    if d//2 < current:
        current -= d
        current = max(-current, current)

#print(targets)
#print(can_avoids)

for q in qs:
    if (can_avoids[q-1]):
        print("YES")
    else:
        print("NO")


exit(0)
Problem p02885 (python)

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

C = int(A) - int(B) * 2

if C < 1:
    print(0)
elif C > 100:
    print(100)
else:
    print(C)

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

List_S = list(S)
Ans = 1

for i in range(N-1):
    if List_S[i] != List_S[i+1]:
        Ans += 1
    
print(Ans)

Buggy submission (verdict: Runtime Error):
import numpy

print("A = ")
A = input()

print("B = ")
B = input()

C = int(A) - int(B) * 2

if C < 0:
    print(0)
elif C > 100:
    print(100)
else:
    print(C)
Problem p02898 (python)

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

c = 0

for i in range(n):
    if h[i] >= k:
        c += 1
print(c)

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

h.sort()
for i in range(n):
    if h(i) < k:
        break
print(i)
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
print(min(n*a,b)
Problem p03047 (python)

Fixed submission:
a,b = map(int,input().split())
print(a-b+1)

Buggy submission (verdict: Runtime Error):
a,b = map(int(input().split()))
print(a-b+1)
Problem p03080 (python)

Fixed submission:
n = int(input())
s = input()
a = s.count('R')
if a > n-a:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
4
RRBR
Problem p03110 (python)

Fixed submission:
n = int(input())
c = 0
for i in range(n):
    a,b = input().split()
    if b == 'JPY':
        c += int(a)
    else:
        c +=380000*float(a)
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = 0
for i in range(n):
    a,b = map(input().split())
    if b == 'JPY':
        c += a
    else:
        c +=380000*a
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = 0
for i in range(n):
    a,b = map(int,input().split())
    if b == 'JPY':
        c += a
    else:
        c +=380000*a
print(c)
Problem p03131 (python)

Fixed submission:
k,a,b = map(int,input().split())
if a+2 > b:
    print(k+1)
else:
    print(a + (b-a)*((k-a+1)//2) + (k-a+1)%2)

Buggy submission (verdict: Runtime Error):
K,A,B=map(int,input().split())
K1=K-(A+1)
n=K1//2
print(max(K+1,((n+1)*B-n*A+K1%2)))
#
K,A,B=map(int,input().split())
print(A+((K-A+1)//2)*(B-A)+(K-A+1)%2) if(B-A>2 and K-A>0) else print(K+1)
#
k,a,b = map(int,input().split())
if a+2 > b:
    print(k+1)
else:
    print(a-1 + (b-a)*(k-a+1)//2 + (k-a+1)%2)
Problem p03146 (python)

Fixed submission:
def f(n):
    if n%2==0:
        return n//2
    else:
        return 3*n+1
s=int(input())
a=list()
i=1
while 1:
    if s in a:
        break
    a.append(s)
    s=f(s)
    i+=1
print(i)

Buggy submission (verdict: Runtime Error):
def f(n):
    if n%2==0:
        n//2
    else:
        3*n+1
s=int(input())
a=list()
i=1
while 1:
    if f(s) in a:
        break
    a.append(f(s))
    s=f(s)
    i+=1
print(i)
Problem p03150 (python)

Fixed submission:
a = 'keyence'
s = input()
S = len(s)
if s[:7] == 'keyence':
    print('YES')
elif s[:6] == 'keyenc' and s[-1] == 'e':
    print('YES')
elif s[:5] == 'keyen' and s[-2:] == 'ce':
    print('YES')
elif s[:4] == 'keye' and s[-3:] == 'nce':
    print('YES')
elif s[:3] == 'key' and s[-4:] == 'ence':
    print('YES')
elif s[:2] == 'ke' and s[-5:] == 'yence':
    print('YES')
elif s[0] == 'k' and s[-6:] == 'eyence':
    print('YES')
elif s[-7:] == 'keyence':
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a = 'keyence'
s = input()
S = len(s)
c = 0
i = 0
while i < S:
    if s[i] == a[c]:
        c += 1
    i += 1
if c == 7:
    print('YES')
else:
    print('NO')
Problem p03238 (python)

Fixed submission:
n = int(input())
if n ==1:
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)

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

if n ==1:
    print('Hello World')
else:
    print(a + b)
Problem p03241 (python)

Fixed submission:
n,m = map(int,input().split())
l = m//n

def x():
    for i in range(l+1)[::-1]:
        if m % i == 0:
            return i
print(x())

Buggy submission (verdict: Runtime Error):
from sympy import divisors

n,m = map(int,input().split())
l = m//n
a = list(divisors(m,generator=True))
c = 0

for i in range(len(a)):
    if a[i] > c and a[i] <= l:
        c = a[i]

print(c)

Buggy submission (verdict: Runtime Error):
from sympy import divisors
n,m = map(int,input().split())
l = m//n
a = list(divisors(m,generator=True))
c = 0

for i in range(len(a)):
    if a[i] > c and a[i] <= l:
        c = a[i]

print(c)

Buggy submission (verdict: Runtime Error):
import sympy
n,m = map(int,input().split())
l = m//n
a = list(sympy.divisors(m,generator=True))
c = 0
for i in range(1,len(a)):
    if a[i] > c and a[i] <= l:
        c = a[i]

print(c)
Problem p03254 (python)

Fixed submission:
N,X = map(int,input().split())
a = list(map(int,input().split()))
a.sort()

b = []
for _ in range(N):
    b.append(0)
    
c = 0

for i in range(N):
    for j in range(i+1):
        b[i] += a[j]

for k in range(N-1):
    if b[k] <= X:
        c += 1
if b[N-1] == X:
    c += 1
print(c)

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

b = []
for i in range(N):
    b.append(i)
c = 0
d = []
for i in range(N):
    d.append(i)
for i in range(N):
    b[i] = d
    for j in range(N):
        d[j] += a[j]
for i in range(N):
    if b[i] <= X:
        c += 1
print(c)
Problem p03280 (python)

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

print((A-1) * (B-1))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print((A-1) * (B-1))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

print((A-1) * (B-1))
Problem p03281 (python)

Fixed submission:
N = int(input())

if N < 105:
    print(0)
elif N < 135:
    print(1)
elif N < 165:
    print(2)
elif N < 189:
    print(3)
elif N < 195:
    print(4)
else:
    print(5)

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

for i in range(1,N+1):
    if i % 2 == 0:continue
    c = 0
    for j in range(1,N+1):
        if c > 8:
            cnt -= 1:continue
        if i % j == 0:
            c += 1
    if c ==8:
        cnt += 1
print(cnt)

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

for i in range(1,N+1)
    if i % 2 == 0:continue
    c = 0
    for j in range(1,N+1):
        if c > 8:
            cnt -= 1:continue
        if i % j == 0:
            c += 1
    if c ==8:
        cnt += 1
print(cnt)

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

for i in range(1,N+1)
    if i % 2 == 0:continue
    c = 0
    for j in range(1,N+1):
        if cnt > 8:
            cnt -= 1:continue
        if i % j == 0:
            c += 1
    if c ==8:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
if N < 105:
    print(0)
elif N < 165:
    print(1)
elif N < 195:
    print(2)
else:
    print(3)

Buggy submission (verdict: Runtime Error):
if N < 105:
    print(0)
elif N < 165:
    print(1)
else N < 195:
    print(2)
else:
    print(3)
Problem p03282 (python)

Fixed submission:
s=input()
k=int(input())
n=0
for i in s:
    if int(i)==1:
        n+=1
    else:
        break
if n < k:
    print(s[n])
else:
    print(1)

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
n=0
for i in s:
    if int(i)==1:
        n+=1
    else:
        break
if n < k:
    pritn(s[n])
else:
    print(1)

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

A = S.count('1')

for i in range(0,A):
    S.remove('1')

print(S[0])
Problem p03284 (python)

Fixed submission:
N,K = map(int,input().split())
if N % K == 0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input())
if N % K = 0:
    print(0)
else:
    print(1)
Problem p03288 (python)

Fixed submission:
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Buggy submission (verdict: Runtime Error):
S = input()
S1 = list(S)
i = 0

if ((S1[1] == 'C') or (S1[-1] == 'C')):
    print('WA')
elif ((S1[0] == 'A') and (S1[2:-1].count('C') == 1)):
    S1.remove('A')
    S1.remove('C')
    while i <= len(S1):
        if S1[i].isupper():
            print('WA')
            i += 1
        break
    else:
        print('AC')
Problem p03292 (python)

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

print(a[2]-a[0])

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

print(a[2]-[0])
Problem p03294 (python)

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

print(sum(a)-n)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
x = min(3000,reduce(gcd,_ for _ in a))
m = [0]*x

for i in range(x):
    for j in a:
        m[i] += m%j

print(max(m))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
x = min(3000,gcd(_ for _ in a))
m = [0]*x

for i in range(x):
    for j in a:
        m[i] += m%j

print(max(m))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
x = min(3000,gcd(a[i] for i in range(n)))
m = [0]*x

for i in range(x):
    for j in a:
        m[i] += m%j

print(max(m))
Problem p03296 (python)

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

c = 0
i = 0
ans = 0
while i < n-1:
    if a[i] == a[i+1]:
        c += 1
        i += 1
    else:
        ans += (c+1)//2
        c = 0
        i += 1
print((ans+(c+1)//2,ans)[c==0])

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

c = 0
i = 0
ans = 0
while i < n:
    if a[i] == a[i+1]:
        c += 1
        i += 1
    else:
        ans += c//2
        c = 0
        i += 1
print((ans+c//2,ans)[c==0])
Problem p03324 (python)

Fixed submission:
d, n = map(int, input().split())
print((n + n // 100) * 100 ** d)

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

if D == 0:
    pritn(N)
elif D == 1:
    print(N * 100)
else:
    print(N * 10000)
Problem p03338 (python)

Fixed submission:
n = int(input())
s = list(input())
l = [0]*n
for i in range(n):
    s1 = set(s[:i:])
    s2 = set(s[i::])
    l[i] = len(s1&s2)
print(max(l))

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

if n%2 == 0:
    s1 = set(s[:n//2:])
    s2 = set(s[n//2::])
    print(len(s1&s2))
else:
    s1 = set(s[:n//2:])
    s2 = set(s[n//2::])
    s3 = set(s[:(n//2)+1:])
    s4 = set(s[(n//2)+1::])
    print(max(len(s1&s2),len(s3,s4)))

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

if n%2 == 0:
    s1 = set(s[:n//2])
    s2 = set(s[n//2:])
    print(len(s1&s2))
else:
    s1 = set(s[:n//2])
    s2 = set(s[n//2:])
    s3 = set(s[:(n//2)+1])
    s4 = set(s[(n//2)+1:])
  print(max(len(s1&s2),len(s3,s4)))
Problem p03339 (python)

Fixed submission:
n=int(input())
s=input()
c=s[1:].count('E')
a=c
for i in range(1,n):
    if s[i-1]=='W':
        c+=1
    if s[i]=='E':
        c-=1
    a=min(a,c)
print(a)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
c=[]
cnt=1
for i in range(n-1):
    if s[i] = s[i+1]:
        cnt += 1
    else:
        c.append(cnt)
        cnt=1
if s[n-2]==s[n-1]:
    c.append(cnt)
else:
    c.append(1)
print(min(c))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
c=[]
cnt=1
for i in range(n-1):
    if s[i] = s[i+1]:
        cnt += 1
    else:
        c+=cnt
        cnt=1
if s[n-2]==s[n-1]:
    c+=cnt
else:
    c+=1
print(min(c))
Problem p03352 (python)

Fixed submission:
x = int(input())
a =[1]
c = 1
n = 2
while c <= 33:
    n = 2
    c += 1
    while c**n<=1000:
        a.append(c**n)
        n += 1
for i in range(len(a)):
    if a[i] > x:
        a[i] = -1000
    else:
        a[i] -= x
print(a[a.index(max(a))]+x)

Buggy submission (verdict: Runtime Error):
x = int(input())
a =[]
c = 1
n = 2
while c <= 33:
	n = 2
    c += 1
    while c**n<=1000:
        a.append(c*n)
        n +=1
a.sort()
for i in range(len(a)):
    if a[i] > x:
        a[i] = -1000
    else:
        a[i] -= x
print(a[a.index(max(a))])

Buggy submission (verdict: Runtime Error):
n=int(input())
c=[0]*10
for i in range(1:10):
    c[i]=(int(n**(1/i)))**i
    if c[i]>n:
        c[i]=0
print(max(c))

Buggy submission (verdict: Runtime Error):
n=int(input())
c=[0]*10
for i in range(1:10):
    c[i]=(int(n**(1/i)))**i
    if c[i]>0:
        c[i]=0
print(max(c))
Problem p03371 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c,x,y = map(int,input().splir())
cnt = 0
if 2*c < a+b:
    cnt += abs(x-y)*c*2
    if x > y:
        c += (x-y)*a
    else:
        c += (y-x)*b
else:
    cnt += a*x + b*y
print(cnt)
Problem p03379 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
c=b[n//2]
d=b[n//2-1]
for i in range(n):
    print(c if a[i]<=d else d)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
for i in range(n):
    c=b.remove(a[i])
    print(c[n//2-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    b=sorted(del a[i])
    print(b[n//2-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    b=sorted(del a[i])
    print(b[n//2])
Problem p03380 (python)

Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
print(b,min(a,key=lambda x :abs(b-2*x)))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
d=0
e=0
for i in [n//2-1,n//2]:
    c=1
    A=a[i]
    for j in range(i+1)[A:i+1]:
        c*=j
    for k in range(1,A+1):
        c/=k
    if d < c:
        d=c
        e=A
print(b,e)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
d=0
for i in [n//2-1,n//2]:
    c=1
    A=a[i]
    for j in range(i+1)[A:i+1]:
        c*=j
    for k in range(1,A+1):
        c/=k
    if d < c:
        d=c
print(b,d)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
d=0
for i in b:
    c=1
    A=a[i]
    for j in range(i+1)[A:i+1]:
        c*=j
    for k in range(1,A+1):
        c/=k
    if d < c:
        d=c
print(b,d)
Problem p03385 (python)

Fixed submission:
s = set(list(input()))
if s == {'a','b','c'}:
    print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = set(list(int(input())))
if s == {'a','b','c'}:
    print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = set(list(int(input())))
if s = {'a','b','c'}:
    print('Yes')
else:
  print('No')
Problem p03408 (python)

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

S=set(s[i] for i in range(n))
L=len(S)
x = list(S)
a=[0]*(L+1)
for i in range(L):
    a[i]=s.count(x[i])-t.count(x[i])
print(max(a))

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

S=set(s[i] for i in range(n))
L=len(S)
a=[0]*(L+1)
for i in range(L):
    a[i]=s.count(S[i])-t.count(S[i])
print(max(a))

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

S=set(s[i] for i in range(n))
L=len(S)
a=[0]*(L+1)
for i in L:
    a[i]=s.count(S[i])-t.count(S[i])
print(max(a))

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

S=set(s)
L=len(S)
a=[0]*(L+1)
for i in L:
    a[i]=s.count(S[i])-t.count(S[i])
print(max(a))
Problem p03415 (python)

Fixed submission:
a = input()
b = input()
c = input()

print(a[0]+b[1]+c[2])

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
[a,b] = [a,b].sort()
if a == 1:
    if b==1:
        print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
a,b = list(a,b).sort()
if a == 1:
    if b==1:
        print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
if a == 1:
    if b==1:
        print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))

Buggy submission (verdict: Runtime Error):
a = list(input().split())
b = list(input().split())
c = list(input().split())

print(a[0]+b[1]+c[2])

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

print(a[0]+b[1]+c[2])

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

print(a[0],b[1],c[2])
Problem p03417 (python)

Fixed submission:
a, b = map(int,input().split())
c = [a,b]
c.sort()
if c[0] == 1:
    if c[1]==1:
        print(1)
    else:
        print(c[1]-2)
else:
    print((c[0]-2) * (c[1]-2))

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
[a,b] = [a,b].sort()
if a == 1:
    if b==1:
        print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
list(c) = [a,b]
c =  c.sort()
if a == 1:
    if b==1:
        print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
if a == 1:
    if b==1:
    print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))
Problem p03425 (python)

Fixed submission:
n=int(input())
m,a,r,c,h=0,0,0,0,0
for i in range(n):
    s=input()
    if s[0]=='M':
        m+=1
    elif s[0]=='A':
        a+=1
    elif s[0]=='R':
        r+=1
    elif s[0]=='C':
        c+=1
    elif s[0]=='H':
        h+=1
x=[m,a,r,c,h]
cnt=x.count(0)
for i in range(cnt):
    x.remove(0)

l=len(x)
if l<3:
    print(0)
elif l==3:
    print(x[0]*x[1]*x[2])
elif l==4:
    a,b,c,d=x[0],x[1],x[2],x[3]
    print(a*b*c+a*b*d+a*c*d+b*c*d)
else:
    a,b,c,d,e=x[0],x[1],x[2],x[3],x[4]
    print(a*b*c+a*b*d+a*c*d+b*c*d\
         +e*a*b+e*a*c+e*a*d+e*b*c+e*b*d\
         +e*c*d)

Buggy submission (verdict: Runtime Error):
n=int(input())
m,a,r,c,h=0,0,0,0,0
for i in range(n):
    s=input()
    if s[0]=='M':
        m+=1
    elif s[0]=='A':
        a+=1
    elif s[0]=='R':
        r+=1
    elif s[0]=='C':
        c+=1
    elif s[0]=='H':
        h+=1
x=del ([m,a,r,c,h],0)
x.sort()
l=len(x)
if l<3:
    print(0)
elif l==3:
    print(x[0]*x[1]*x[2])
elif l==4:
    print()
else:
    print()
Problem p03434 (python)

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

a.sort()
a = a[::-1]
for i in range(n):
    c = c + ((-1)**(i%2))*a[i]

print(c)

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

a.sort()[::-1]

for i in range(n):
    c = c + ((-1)**(i%2))*c[i]

print(c)
Problem p03435 (python)

Fixed submission:
c = [list(map(int,input().split())) for i in range(3)]
a1,a2,a3,b1,b2,b3 = 0,c[1][0]-c[0][0],\
c[2][0]-c[0][0],c[0][0],c[0][1],c[0][2]

if c[1][1]==a2+b2 and c[1][2]==a2+b3 and\
c[2][1]==a3+b2 and c[2][2]==a3+b3:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
c = [[map(int,input().split())] for i in range(3)]
a1,a2,a3,b1,b2,b3 = 0,c[1][0]-c[0][1],\
c[2][0]-c[0][2],c[0][0],c[0][1],c[0][2]

if c[1][1]==a2+b2 and c[1][2]==a2+b3 and\
c[2][1]==a3+b2 and c[2][2]==a3+b3:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
c = [map(int,input().split()) for i in range(3)]
a1,a2,a3,b1,b2,b3 = 0,c[1][0]-c[0][1],\
c[2][0]-c[0][2],c[0][0],c[0][1],c[0][2]

if c[1][1]==a2+b2 and c[1][2]==a2+b3 and\
c[2][1]==a3+b2 and c[2][2]==a3+b3:
    print('Yes')
else:
    print('No')
Problem p03447 (python)

Fixed submission:
x=int(input())
a=int(input())
b=int(input())

print((x-a)%b)

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

print((x-a)%b)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
if (a%2==1) and (b%2==1):
    print('Odd')
else:
    print('Even')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a%2=1) and (b%2=1):
    print('Odd')
else:
    print('Even')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%2=1 and b%2=1:
    print('Odd')
else:
    print('Even')
Problem p03470 (python)

Fixed submission:
n = int(input())
d = [input() for i in range(n)]

print(len(set(d)))

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {}
for i in range(n):
    d += int(input())

print(len(d))
Problem p03471 (python)

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

for i in range(n+1):
    for j in range(n-i+1):
        if 10*i + 5*j + (n-i-j) == y:
            print(i,j,n-i-j)
            exit()
print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
n,y = map(int,input().split())
y //= 1000
a,b,c = 0,0,0

for i in range(n):
    for j in range(n-j):
        if 10*i + 5*j + (n-i-j) == y:
            print(i,j,n-i-j)
            exit()
print('-1 -1 -1')
Problem p03475 (python)

Fixed submission:
n = int(input())
c,s,f = [0]*n,[0]*n,[0]*n
for i in range(n-1):
    c[i],s[i],f[i] = map(int,input().split())
for i in range(n):
    cnt = 0
    j = i
    while j < n-1:
        if cnt <= s[j]:
            cnt = s[j]+c[j]
        else:
            cnt = s[j]+f[j]*((cnt - s[j])//f[j])+\
            [f[j],0][((cnt - s[j])%f[j])==0]+c[j]
        j += 1
    print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
c,s,f = [0]*n,[0]*n,[0]*n
for i in range(n-1):
    c[i],s[i],f[i] = map(int,input().split())
for i in range(n):
    cnt = 0
    j = i
    while j < n-1:
        if cnt <= s[j]:
            cnt += s[j]+c[j]
        else:
            cnt = s[j]+(cnt - s[j])//f[j]+[0,1]((cnt - s[j])%f[j])+c[j]
        j += 1
    print(cnt)