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

Fixed submission:
import fractions

def lcm(x,y):
	return (x*y)//fractions.gcd(x,y)
count = 0
A,B,C,D= map(int,input().split())
lcm = lcm(C,D)
E = (A-1)//C
F = (A-1)//D
G = (A-1)//lcm
H = B//C
I = B//D
J = B//lcm

count = (B-A+1)-((H-E)+(I-F)-(J-G))

print(count)

Buggy submission (verdict: Runtime Error):
import math 

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

A,B,C,D= map(int,input().split())
lcm = lcm(C,D)
E = int((A-1)/C)
F = int((A-1)/D)
G = int((A-1)/lcm)
H = int(B/C)
I = int(B/D)
J = int(B/lcm)

count = (B-A+1)-((H-E)+(I-F)-(J-G))

print(count)

Buggy submission (verdict: Runtime Error):
import math 

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

A,B,C,D= map(int,input().split())
lcm = lcm(C,D)
E = (A-1)//C
F = (A-1)//D
G = (A-1)//lcm
H = B//C
I = B//D
J = B//lcm

count = (B-A+1)-((H-E)+(I-F)-(J-G))

print(count)

Buggy submission (verdict: Runtime Error):
import math 

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

A,B,C,D= map(int,input().split())
lcm = lcm(C,D)
E = (A-1)//C
F = (A-1)//D
G = (A-1)//lcm
H = B//C
I = B//D
J = B//lcm

count = (B-A+1)-((H-E)+(I-F)-(J-G))

print(count)
Problem p02999 (python)

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

if X<A :
	print(0)
else:
	print(10)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
tmp=0
ans=1
for i in range(N):
	tmp+=L[i]
	if tmp>X:
		print(ans)
		exit()
	else:
		ans+=1
print(ans)
Problem p03109 (python)

Fixed submission:
S=input()

M=int(S[5])*10+int(S[6])
if M>4:
	print("TBD")
else:
	print("Heisei")

Buggy submission (verdict: Runtime Error):
S=input()
M=S[5]*10+S[6]
if M>4:
	print("TBD")
else:
	print("Heisei")
Problem p03261 (python)

Fixed submission:
N=int(input())
L=[]
count=0
for i in range (N):
	L.append(input())
if len(set(L))!=N:
	print("No")
else:
	for i in range (N-1):
		if L[i][-1]!=L[i+1][0]:
			count+=1
	if count==0:
		print("Yes")
	else:
		print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
L=[]
count=0
for i in range (N):
	L.append(int(input()))
if len(set(L))!=N:
	print("No")
else:
	for i in range (N-1):
		if L[i][-1]!=L[i+1][0]:
			count+=1
	if count==0:
		print("Yes")
	else:
		print("No")
Problem p03280 (python)

Fixed submission:
A,B=map(int,input().split())
print((A-1)*(B-1))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input(.split())
print((A-1)*(B-1))
Problem p03293 (python)

Fixed submission:
S=input()
T=input()
for i in range(len(S)):
	S=S[-1]+S[0:-1]
	if S==T:
		print("Yes")
		exit()
print("No")

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

if S.sort()==T.sort():
	print("Yes")
else:
	print("No")
Problem p03324 (python)

Fixed submission:
D,N=map(int,input().split())
if D==0:
	if N==100:
		print(101)
	else:
		print(N)
elif D==1:
	if N==100:
		print(101*100)
	else:
		print(N*100)
	
elif D==2:
	if N==100:
		print(101*100*100)
	else:
		print(N*100*100)

Buggy submission (verdict: Runtime Error):
D,N=map(int,input().split())
if D==0:
	if N=100:
		print(101)
	else:
		print(N)
elif D==1:
	if N=100:
		print(101*100)
	else:
		print(N*100)
	
elif D==2:
	if N=100:
		print(101*100*100)
	else:
		print(N*100*100)
Problem p03371 (python)

Fixed submission:
A,B,C,X,Y=map(int,input().split())
if X>=Y:
	Z=A*(X-Y)
else:
	Z=B*(Y-X)
print(min(A*X+B*Y,min(X,Y)*2*C+Z,C*max(X,Y)*2))

Buggy submission (verdict: Runtime Error):
A,B,C,X,Y=map(int,input().split())
if X>=Y:
	Z=A*(X-Y)
else:
	Z=B*(Y-Z)
print(min(A*X+B*Y,min(X,Y)*C+Z))
Problem p03427 (python)

Fixed submission:
N=input()
M=int(N[0:2])
L=len(N[2:])*9
K=0
sum=0
for i in range(len(N)):
	sum+=int(N[i])
K=0
if L>0:
	D=M
else:
	D=M+1
for i in range(D):
	j=str(i)
	if len(j)==1:
		K=max(K,(int(j)))
	else:
		K=max(K,(int(j[0])+int(j[1])))
print(max(sum,K+L))

Buggy submission (verdict: Runtime Error):
N=input()
M=len(str(N))
K=int(N[0])
ans=0
for i in range (M):
	ans+=N[i]

print(max(9*(M-1)+(K-1)),ans)

Buggy submission (verdict: Runtime Error):
N=input()
M=len(str(N))
K=int(N[0])
ans=0
for i in range (M):
	ans+=N[i]
print(max(9*(M-1)+(K-1),ans))
Problem p03623 (python)

Fixed submission:
L=list(map(int,input().split()))
A=abs(L[0]-L[1])
B=abs(L[0]-L[2])
if min(A,B)==A:
	print("A")
else:
	print("B")

Buggy submission (verdict: Runtime Error):
L=list(map(int,input().split()))
A=L[0]-L[1]
B=L[0]-L[2]
if min(A,B)=A:
	print("A")
else:
	print("B")
Problem p03651 (python)

Fixed submission:
import fractions
N,K=map(int,input().split())
L=list(map(int,input().split()))
tmp=0
if N==1:
	if L[0]==K:
		print("POSSIBLE")
		exit()
	else:
		print("IMPOSSIBLE")
		exit()
for i in range(1,N):
	if i==1:
		tmp=fractions.gcd(L[0],L[1])
	else:
		tmp=fractions.gcd(tmp,L[i])
if max(L)>=K and K%tmp==0:
	print("POSSIBLE")
else:
	print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import fractions
N,K=map(int,input().split())
L=list(map(int,input().split()))
tmp=0
for i in range(1,N):
	if i==1:
		tmp=fractions.gcd(L[0],L[1])
	else:
		tmp=fractions.gcd(tmp,L[i])
if max(L)>=K and K%tmp==0:
	print("POSSIBLE")
else:
	print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import fractions
N,K=map(int,input().split())
L=list(map(int,input().split()))
tmp=0
for i in range(1,N):
	if i==1:
		tmp=fractions.gcd(L[0],L[1])
	else:
		tmp=fractions.gcd(tmp,L[i])
if tmp<K and K%tmp==0:
	print("POSSIBLE")
else:
	print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import fractions
N,K=map(int,input().split())
L=list(map(int,input().split()))
tmp=0
if max(L)<K:
	print("IMPOSSIBLE")
	exit()
for i in range(1,N):
	if i==1:
		if L[0]==K or L[i]==K:
			print("POSSIBLE")
			exit()
		tmp=fractions.gcd(L[0],L[1])
		if tmp<=K and K%tmp==0:
			print("POSSIBLE")
			exit()
	else:
		ifL[i]==K:
			print("POSSIBLE")
			exit()
		tmp=fractions.gcd(tmp,L[i])
		if tmp<=K and K%tmp==0:
			print("POSSIBLE")
			exit()
print("IMPOSSIBLE")
Problem p03671 (python)

Fixed submission:
L=list(map(int,input().split()))
K=sorted(L)
print(K[0]+K[1])

Buggy submission (verdict: Runtime Error):
L=list(,ap(int,input().split()))
K=sorted(L)
print(L[0]+K[1])
Problem p03679 (python)

Fixed submission:
X,A,B=map(int,input().split())
if A>=B:
	print("delicious")
elif B>A and X+A>=B :
	print("safe")
else:
	print("dangerous")

Buggy submission (verdict: Runtime Error):
X,A,B=map(int,input().split())
if A>=B:
	print("delicious")
elif A<B and B=<A+X:
	print("safe")
else:
	print("dangerous")
Problem p03777 (python)

Fixed submission:
A,B=map(str,input().split())
if A=="H":
	print(B)
else:
	if B=="H":
		print("D")
	else:
		print("H")

Buggy submission (verdict: Runtime Error):
A,B=map(input().split())
if A=="H":
	print(B)
else:
	if B=="H":
		print("D")
	else:
		print("H")
Problem p03807 (python)

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
count=0
for i in range (N):
	if L[i]%2==1:
		count+=1
if count%2==1:
	print("NO")
else:
	print("YES")

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
count=0
for i in range N:
	if L[i]%2==1:
		count+=1
if count%2==1:
	print("NO")
else:
	print("YES")
Problem p03848 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
if N%2==0:
	for i in range (N):
		if A[i]%2 != 1:
			print(0)
			exit()
	print((2**(N//2))%(10**9+7))
else:
	for i in range (N):
		if A[i]%2!=0:
			print(0)
			exit()
	if min(A)!=0 or A.count(0)!=1:
		print(0)
		exit()
	else:
		print((2**((N-1)//2))%(10**9+7))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
if N%2==0:
	for i in range (N):
		A[i]%2!=1:
			print(0)
			exit()
	print((2**N)%(10**9+7))
else:
	for i in range (N):
		A[i]%2!=0:
			print(0)
			exit()
	if min(A)!=0:
		print(0)
		exit()
	else:
		print((2**(N-1))%(10**9+7))
Problem p02690 (python)

Fixed submission:
def calcurate(x):
  for a in range(1000):
    a5 = a**5
    for b in range(-1000, 1000):
      b5 = b**5
      if a5 - b5 == X:
        return a, b
      
if __name__ == "__main__":
  X = int(input())
  A, B = calcurate(X)
  print(A, B)

Buggy submission (verdict: Runtime Error):
X = int(input())
for A in range(0, X):
  
  A5 = A**5
  B5 = X - A5
  B = B5 ** (1/5) 
  if float.is_integer(B):
    print(A, int(B*-1))
    break
Problem p02789 (python)

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

Buggy submission (verdict: Runtime Error):
n, m = input()

if n == m:
  print('Yes')
else:
  print('No')
Problem p02843 (python)

Fixed submission:
#!python3.4.3

x_str = input()
x = int(x_str)

if x < 100:
    print(0)
else:
    a = int(x_str[:-2])
    b = int(x_str[-2:])

    if a > b:
        print(1)
    else:
        count = 0
        d = b
        for i in range(5, 0, -1):
            c = d // i
            count += c
            if a < count:
                print(0)
                break
            if d % i == 0:
                print(1)
                break
            d = d - c*i

Buggy submission (verdict: Runtime Error):
#!python3.4.3

x_str = input()
x = int(x_str)

a = int(x_str[:-2])
b = int(x_str[-2:])

if a > b:
    print(1)
else:
    count = 0
    d = b
    for i in range(5, 0, -1):
        if d % i == 0:
            print(1)
            break
        c = d // i
        count += c
        if a < count:
            print(0)
            break
        d = d - c*i
Problem p03493 (python)

Fixed submission:
s = [int(x) for x in input()]
print(sum(s))

Buggy submission (verdict: Runtime Error):
n = input()
s = [int(x) for x in input().split(' ')]
count = 0

while sum(map(lambda x: x%2, s)) == 0:
  s =list(map(lambda x: x/2, s))
  count+=1
  
print(count)
Problem p02720 (python)

Fixed submission:
def dfs(A,B):
    if len("".join(A))>10:
        return
    if int(A[-1]) == 0:
        for i in [0,1]:
            A.append(str(i))
            B.append("".join(A))
            dfs(A, B)
            A.pop()
    elif int(A[-1]) == 9:
        for i in [8,9]:
            A.append(str(i))
            B.append("".join(A))
            dfs(A, B)
            A.pop()
    else:
        for i in range(int(A[-1])-1,int(A[-1])+2):
            A.append(str(i))
            B.append("".join(A))
            dfs(A,B)
            A.pop()

if __name__ == "__main__":
    k=int(input())
    ans_list=[]
    num_list=[]
    for i in range(1,10):
        ans_list.append(str(i))
        num_list.append(str(i))
        dfs(num_list,ans_list)
        num_list.clear()
    ans_list=sorted(ans_list,key=int)
    print(ans_list[k-1])

Buggy submission (verdict: Runtime Error):
def dfs(A,B):
    if len("".join(A))>10:
        return
    if int(A[-1]) == 0:
        for i in [0,1]:
            A.append(str(i))
            B.append("".join(A))
            dfs(A, B)
            A.pop()
    elif int(A[-1]) == 9:
        for i in [8,9]:
            A.append(str(i))
            B.append("".join(A))
            dfs(A, B)
            A.pop()
    else:
        for i in range(int(A[-1])-1,int(A[-1])+2):
            A.append(str(i))
            B.append("".join(A))
            dfs(A,B)
            A.pop()

if __name__ == "__main__":
    k=int(input())
    ans_list=[]
    num_list=[]
    for i in range(1,10):
        ans_list.append(str(i))
        num_list.append(str(i))
        dfs(num_list,ans_list)
        num_list.clear()
    ans_list=sorted(ans_list,key=int)
    print(ans_list[k-1])
Problem p02768 (python)

Fixed submission:
n,a,b=map(int,input().split())
MOD=10**9+7
total=(pow(2,n,MOD)-1)%MOD
na=1
nb=1
atotal=1
btotal=1
for i in range(a):
    na=(na*(n-i))%MOD
for i in range(b):
    nb=(nb*(n-i))%MOD
for i in range(1,a+1):
    atotal=(atotal*i)%MOD
for i in range(1, b + 1):
    btotal = (btotal * i) % MOD
atotal=pow(atotal,MOD-2,MOD)%MOD
btotal=pow(btotal,MOD-2,MOD)%MOD
ans=total%MOD-(na*atotal)%MOD-(nb*btotal)%MOD
print(ans%MOD)

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb


if __name__ == "__main__":
    n, a, b = map(int, input().split())
    ans=0
    if n == 2:
        if (a == 1 and b == 1) or (a == 2 and b == 1):
            print(0)
    else:
        for i in range(1, int(n // 2)):
            cnt=2
            if i == a or i == b:
                cnt -= 1
            if (n - i) == a or (n - i) == b:
                cnt -= 1
            ans += comb(n,i,exact=True)*cnt
        if n%2==0 and (int(n//2) !=a and int(n//2) != b):
            ans += comb(n,int(n//2),exact=True)
        if n != a and n != b:
            ans += 1
        print(ans % (10 ** 9 + 7))
Problem p02813 (python)

Fixed submission:
import itertools
import math
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
if p== q:
    print(0)
else:
    sample=[]
    for i in range(1,n+1):
        sample.append(i)
    perm=list(itertools.permutations(sample))
    for i in range(math.factorial(n)):
        perm[i]=list(perm[i])
    ans=[]
    for i in range(math.factorial(n)):
        if list(perm[i]) == p or list(perm[i]) == q :
            ans.append(i+1)
            if len(ans) == 2:
                break

    print(abs(ans[1]-ans[0]))

Buggy submission (verdict: Runtime Error):
import itertools
import math
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
sample=[]
for i in range(1,n+1):
    sample.append(i)
perm=list(itertools.permutations(sample))
for i in range(math.factorial(n)):
    perm[i]=list(perm[i])
ans=[]
for i in range(math.factorial(n)):
    if list(perm[i]) == p or list(perm[i]) == q :
        ans.append(i+1)
        if len(ans) == 2:
            break

print(abs(ans[1]-ans[0]))
Problem p02922 (python)

Fixed submission:
from sys import stdin
 
s,t =input().split()
count=int(s)
goal=int(t)
total=count
cnt=1

while total<goal :
	total=total+count-1
	cnt+=1

if goal==1:
  cnt=0
    
print(cnt)

Buggy submission (verdict: Runtime Error):
from sys import stdin
 
s,t =input().split()
count=int(s)
goal=int(t)
total=count
cnt=1
if goal==1:
  cnt=0
else:
	while total<goal :
 	  total=total+count-1
	  cnt+=1
  
print(cnt)
Problem p02923 (python)

Fixed submission:
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
elif n==2:
    if xlist[0]>=xlist[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
            if i==n-2:
                maxlen.append(count)
        else:
            maxlen.append(count)
            count = 0
    print(max(maxlen))

Buggy submission (verdict: Runtime Error):
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
elif n==2:
    if xlist[0]>=xlist[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
        else:
            maxlen.append(count)
            count = 0
    print(max(max(maxlen), count))

Buggy submission (verdict: Runtime Error):
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
        else:
            maxlen.append(count)
            count = 0
    print(max(max(maxlen), count))

Buggy submission (verdict: Runtime Error):
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
        else:
            maxlen.append(count)
            count = 0

print(max(max(maxlen),count))

Buggy submission (verdict: Runtime Error):
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
for i in range(n-1):
    if xlist[i]>=xlist[i+1]:
        count+=1
    else:
        maxlen.append(count)
        count=0
print(max(max(maxlen),count))
Problem p02981 (python)

Fixed submission:
import sys

n,a,b=(int(x) for x in input().split())

train=n*a
taxi=b
if train>=taxi:
  print(taxi)
else:
  print(train)

Buggy submission (verdict: Runtime Error):
import sys
try:
    while True:
        n = input()
        a=input()
		b=input()
		nn=int(n)
		aa=int(a)
		bb=int(b)
        if n == '':
            break
        if a == '':
            break
        if b == '':
            break
except EOFError:
    pass

train=nn*aa
taxi=bb
if train>=taxi:
  print(train)
else:
  print(taxi)

Buggy submission (verdict: Runtime Error):
import sys
n=input()
a=input()
b=input()
nn=int(n)
aa=int(a)
bb=int(b)

train=nn*aa
taxi=bb
if train>=taxi:
  print(train)
else:
  print(taxi)

Buggy submission (verdict: Runtime Error):
import sys
n=input()
a=input()
b=input()
nn=int(n)
aa=int(a)
bb=int(b)

train=nn*aa
taxi=bb
if train>=taxi:
  print(train)
else:
  print(taxi)

Buggy submission (verdict: Runtime Error):
import sys
n=input()
a=input()
b=input()
train=int(n)*int(a)
taxi=int(b)
if train>=taxi:
  print(train)
else:
  print(taxi)

Buggy submission (verdict: Runtime Error):
import sys
n=input()
a=input()
b=input()
train=n*a
taxi=b
if train>=taxi:
  print(train)
else:
  print(taxi)
Problem p02999 (python)

Fixed submission:
import sys

a,b=(int(x) for x in input().split())

if a>=b:
  print(10)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import sys

a,b=int((x) for x in input().split())

if a>=b:
  print(10)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import sys

X,A=int((x) for x in input().split())

if X>=A:
  print(10)
else:
  print(0)
Problem p03000 (python)

Fixed submission:
s=list(input().split())
l=list(input().split())
n=int(s[0])
x=int(s[1])
count=1
d=0
for i in range(n):
  d=d+int(l[i])
  if d<=x:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import sys
N,X=(int(x) for x in input().split())

L=int(y) for y in input().split()
count = 0
D=[0]
for k in range(0,N+1):
  if(D(k)<=X):
    count += 1
  D.append(D(k)+L(k))
  
print(count)

Buggy submission (verdict: Runtime Error):
import sys
N,X=(int(x) for x in input().split())
L=[]
L.append(int(y) for y in input().split())
count = 0
D=[0]
for k in range(0,N+1):
  if(D(k)<=6):
    count += 1
  D.append(D(k)+L(k))
  
print(count)
Problem p03061 (python)

Fixed submission:
import math
import fractions
n=int(input())
a=list(map(int,input().split()))
left=[0]*(n+1)
right=[0]*(n+1)
left[1]=a[0]
right[1]=a[n-1]
for i in range(2,n+1):
    left[i]=fractions.gcd(left[i-1],a[i-1])
    right[i]=fractions.gcd(right[i-1],a[n-i])
ans=0
for i in range(1,n-1):
    ans=max(ans,fractions.gcd(left[i],right[n-1-i]))
print(max(ans,right[n-1],left[n-1]))

Buggy submission (verdict: Runtime Error):
import math
import fractions
n=int(input())
a=list(map(int,input().split()))
left=[0]*(n+1)
right=[0]*(n+1)
left[1]=a[0]
right[1]=a[n-1]
for i in range(2,n+1):
    left[i]=math.gcd(left[i-1],a[i-1])
    right[i]=math.gcd(right[i-1],a[n-i])
ans=0
for i in range(1,n-1):
    ans=max(ans,math.gcd(left[i],right[n-1-i]))
print(max(ans,right[n-1],left[n-1]))
Problem p03076 (python)

Fixed submission:
x=[]
total=[]
for i in range(5):
  t=list(input())
  if t[-1]=='0':
    total.append(t)
  else:
    x.append(t)
x=sorted(x, key=lambda x: x[-1])
for i in range(1,len(x)):
  total.append(x[i])
if len(x)!=0:
  last=int(''.join(x[0]))

for i in range(4):
  total[i]=int(''.join(total[i]))
  total[i]=-(-total[i]//10)*10
if len(x)==0:
  total[-1]=int(''.join(total[-1]))
  print(sum(total))
else:
  print(sum(total)+last)

Buggy submission (verdict: Runtime Error):
x=[]
total=[]
for i in range(5):
  t=list(input())
  if t[-1]=='0':
    total.append(t)
  else:
    x.append(t)
x=sorted(x, key=lambda x: x[-1])
for i in range(1,len(x)):
  total.append(x[i])
last=int(''.join(x[0]))
for i in range(4):
  total[i]=int(''.join(total[i]))
  total[i]=-(-total[i]//10)*10

print(sum(total)+last)
Problem p03086 (python)

Fixed submission:
S = input()
N = len(S)
ans = 0
for i in range(N):
  for j in range(i, N):
    if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
      ans = max(ans, j - i + 1)
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
word=list(s)
temp=[]
score=[]
for i in range(len(word)):
  if word[i]!='A' and word[i]!='C' and word[i]!='G' and word[i]!='T':
    temp.append(i+1)
if word[0]=='A' or word[0]=='C' or word[0]=='G' or word[0]=='T':
  temp.insert(0,0)
if word[-1]=='A' or word[-1]=='C' or word[-1]=='G' or word[-1]=='T':
  temp.append(len(word)+1)
print(temp)
for i in range(len(temp)-1):
  if temp[i]==0 or temp[i+1]==len(word)+1:
    score.append(temp[i+1]-temp[i]-1)
  else:
    score.append(temp[i+1]-temp[i]-1)
print(max(score))
Problem p03160 (python)

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

dp=[0]
dp.append(abs(h[1]-h[0]))

for i in range(2,n):
    step1=dp[i-1]+abs(h[i]-h[i-1])
    step2=dp[i-2]+abs(h[i]-h[i-2])
    dp.append(min(step1,step2))
print(dp[-1])

Buggy submission (verdict: Runtime Error):
dp={}
#これからかかる分のコストを計算
def dfs(pos,n,h):
    if pos >= n:
        return 999999999
    if pos == n-1:
        return 0
    if pos in dp:
        return dp[pos]
    step1 = dfs(pos+1,n,h) + abs(h[pos+1] - h[pos])
    step2 = dfs(pos+2,n,h) + abs(h[pos+2] - h[pos])
    dp[pos] = min(step1, step2)
    return dp[pos]

if __name__=="__main__":
    n = int(input())
    h = list(map(int, input().split()))
    h.append(0)
    print(dfs(0,n,h))
Problem p03163 (python)

Fixed submission:
n,w=map(int,input().split())
item=[]
for i in range(n):
    tmp=list(map(int,input().split()))
    item.append(tmp)

dp=[[0]*(w+1) for i in range(n+1)]
for i in range(n):
    for j in range(w+1):
        if j >= item[i][0]:
            dp[i+1][j]=max(dp[i][j],dp[i][j-item[i][0]]+item[i][1])
        else:
            dp[i+1][j]=dp[i][j]
print(dp[n][w])

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

dp=[[0]*(n+100) for i in range(w+100)]
for i in range(n):
    for j in range(w+1):
        if j >= item[i][0]:
            dp[i+1][j]=max(dp[i][j],dp[i][j-item[i][0]]+item[i][1])
        else:
            dp[i+1][j]=dp[i][j]
print(dp[n][w])

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

dp=[[0]*(n+10) for i in range(w+10)]
for i in range(n):
    for j in range(w+1):
        if j >= item[i][0]:
            dp[i+1][j]=max(dp[i][j],dp[i][j-item[i][0]]+item[i][1])
        else:
            dp[i+1][j]=dp[i][j]
print(dp[n][w])
Problem p03213 (python)

Fixed submission:
N = int(input())
e = [0] * (N+1)
for i in range(2, N+1):
    cur = i
    for j in range(2, i+1):
         while cur % j == 0:
            e[j] += 1
            cur //= j

def num(m):
    return len(list(filter(lambda x: x >= m-1, e)))

print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1)+ num(5) * (num(5) - 1) * (num(3) - 2) // 2)

Buggy submission (verdict: Runtime Error):
n=int(input())
e=[0]*(n+1)
count=0
ijklist={}
for i in range(2, n+1):
    cur = i
    for j in range(2, i + 1):
        while cur % j == 0:
            e[j] += 1
            cur //= j
for i in range(n+1):
    for j in range(i+1,n+1):
        for k in range(j+1,n+1):
            if e[i]>=4 and e[j]>=4 and e[k]>=2:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
            elif e[i]>=14 and e[j]>=4 and e[k]==0:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
            elif e[i]>=24 and e[j]>=2 and e[k]==0:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
            elif e[i]>=74 and e[j]==0 and e[k]==0:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
print(count)