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

Fixed submission:
line = [int(i) for i in input().split(' ')]
set_line = set(line)
A = [int(i) for i in input().split(' ')]
B = [int(i) for i in input().split(' ')]
C = []
for i in range(line[2]):
  C.append([int(i) for i in input().split(' ')])
  
if line.count(1) == 3:
  print(A[0] + B[0] - C[2])
else:
  min_price = min(A) + min(B)
  for i in range(len(C)):
    price = A[(C[i][0] - 1)] + B[(C[i][1] - 1)] - C[i][2]
    if min_price > price:
      min_price = price
  print(min_price)

Buggy submission (verdict: Runtime Error):
line = [int(i) for i in input().split(' ')]
set_line = set(line)
A = [int(i) for i in input().split(' ')]
B = [int(i) for i in input().split(' ')]
C = []
for i in range(line[2]):
  C.append([int(i) for i in input().split(' ')])
  
if line.count(1) == 3:
  print(A[0] + B[0] - C[2])
else:
  min_price = min(A) + min(B)
  for i in range(len(C)):
    price = A[C[i][0]] + B[C[i][1]] - C[i][2]
    if min_price > price:
      min_price = price
  print(min_price)
Problem p02946 (python)

Fixed submission:
lines = input().split(" ")
K = int(lines[0])
X = int(lines[1])
arr = []

if K == 1:
  print(X)
else:
  for i in range(X , X + K):
    arr.append(i)
    
  for j in range(X - K + 1 , X):
    arr.append(j)
    
arr.sort()
map_result = map(str, arr)
result = ' '.join(map_result)
print(result)

Buggy submission (verdict: Runtime Error):
lines = input().split(" ")
K = int(lines[0])
X = int(lines[1])
arr = []

if K == 1:
  print(X)
else:
  for i in range(X , X + K):
    arr.append(i)
    
  for j in range(X - K + 1 , X):
    arr.append(j)
    
arr.sort()
print(arr.join(" "))
Problem p02957 (python)

Fixed submission:
arr = input().split(" ")
A = int(arr[0])
B = int(arr[1])
 
if (A + B) % 2 == 0:
    print(int((A + B) / 2))
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
arr = input().split(" ")
A = int(arr[0])
B = int(arr[1])
 
K = (A + B) / 2
if isinstance(K, int) == true:
  print(K)
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
arr = input().split(" ")
A = int(arr[0])
B = int(arr[1])

K = (A + B) / 2
if isinstance(K, int) == true:
  print(K)
else:
  print("IMPOSSIBLE")
Problem p03071 (python)

Fixed submission:
arr = input().split(" ")
A = int(arr[0])
B = int(arr[1])

if A == B:
  print(A + B)
elif A > B and (A - B) == 1:
  print(A + (A -1))
elif A > B and (A - B) >= 2:
  print(A + (A - 1))
elif A < B and (B - A) == 1:
  print(A + B)
elif A < B and (B - A) >= 2:
  print(B + (B -1))

Buggy submission (verdict: Runtime Error):
arr = input().split(" ")
A = int(arr[0])
B = int(arr[1])

if A == B:
  print(A + B)
 elif A > B and (A - B) == 1:
  print(A + (A -1))
 elif A > B and (A - B) >= 2:
  print(A + (A - 1))
 elif A < B and (B - A) == 1:
  print(A + B)
 elif A < B and (B - A) >= 2:
  print(B + (B -1))
Problem p03076 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
dic = {"A":A,"B":B,"C":C,"D":D,"E":E}
 
arr1 = []
arr2 = []
res = 0
 
for k,v in dic.items():
    if v % 10 != 0:
        arr1.append((int(v / 10) + 1 ) * 10 - v)
    res += v
    
if len(arr1) > 0:
    fraction = sum(arr1)     
    for i in arr1:
        arr2.append(fraction - i)

    print(res + min(arr2))
else:
    print(res)

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

dic = {"A":A,"B":B,"C":C,"D":D,"E":E}

arr1 = []
arr2 = []
res = 0

for k,v in dic.items():
    if v % 10 != 0:
        arr1.append((int(v / 10) + 1 ) * 10 - v)
    res += v

fraction = sum(arr1)     
for i in arr1:
    arr2.append(fraction - i)

print(res + min(arr2))
Problem p03106 (python)

Fixed submission:
val = input().split(" ")
A = int(val[0])
B = int(val[1])
K = int(val[2])
 
arr1 = [i for i in range(1,A + 1) if A % i == 0]
arr2 = [j for j in range(1,B + 1) if B % j == 0]
 
result = list(set(arr1) & set(arr2))
result.sort(reverse=True)
print(result[K - 1])

Buggy submission (verdict: Runtime Error):
val = input().split(" ")
A = int(val[0])
B = int(val[1])
K = int(val[2])
 
arr1 = [i for i in range(1,A + 1) if A % i == 0]
arr2 = [j for j in range(1,B + 1) if B % j == 0]
 
result = list(set(arr1) & set(arr2))
result.sort(revarse=True)
print(result[K - 1])

Buggy submission (verdict: Runtime Error):
val = input().split(" ")
A = int(val[0])
B = int(val[1])
K = int(val[2])

arr1 = [i for i in range(1,A + 1) if A % i == 0]
arr2 = [j for j in range(1,B + 1) if A % j == 0]

result = list(set(arr1) & set(arr2))
result.sort()

print(result[k - 1])
Problem p02742 (python)

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

h = int(s[0])
w = int(s[1])
if w == 1 or h == 1:
    print(1)
else: 
	r = (h*w+1) /2 if h %2 !=0 and w %2 !=0 else h*w/2
	print(int(r))

Buggy submission (verdict: Runtime Error):
h = int(input())
w = int(input())

r = h*w /2 if h%2 ==0 or w %2==0 else (h*w+1)/2 

print(r)
Problem p03494 (python)

Fixed submission:
mylist = []
for i in range(0, 2):
    val = input()
    if ' ' in val:
        mylist.append(val)
a = list((map (int,mylist[0].split(' '))))

cnt = 0
while True:
    map (int,a)
    if all(map(lambda x: x % 2 == 0, a)) == False:
        break
    a = list(map(lambda x:x//2,a))
    cnt +=1
print (cnt)

Buggy submission (verdict: Runtime Error):
mylist = []
for i in range(0, 2):
    val = input()
    if val:
        mylist.append(val)
a = mylist[1:]

cnt = 0
while True:
    if all(map(lambda x: x % 2 == 0, a)) == False:
        break
    a = list(map(lambda x:x//2,a))
    cnt +=1
print (cnt)
Problem p02741 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[n+1])
Problem p02741 (python)

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

Buggy submission (verdict: Runtime Error):
list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(list[int(input())])

Buggy submission (verdict: Runtime Error):
list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(list[input()])
Problem p02743 (python)

Fixed submission:
import math
a,b,c=map(int,input().split())
if a >= c or b >= c:
    print("No")
else:
    left= 4*a*b 
    right = (c-a-b)**2
    if left < right:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b,c=map(int,input().split())
if 4*a*b < (c-a-b)**2):
    print("Yes")
else:
    print("No")
Problem p03087 (python)

Fixed submission:
n, q = map(int, input().split())
s = input()
# table = [0] * 100005
table = [0] * n
for i in range(1, n):
    table[i] = table[i - 1]
    if s[i] == "C" and s[i - 1] == "A":
        table[i] += 1

for i in range(q):
    first, last = map(int, input().split())
    print(table[last - 1] - table[first - 1])

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

for i in range(3):
    first, last = map(int, input().split())
    print(s.count("AC", first - 1, last))
Problem p03408 (python)

Fixed submission:

n=int(input())
blue=[input() for _ in range(n)]
bset = set(blue)

m=int(input())
red=[input() for _ in range(m)]

print(max([max(0, blue.count(b) - red.count(b)) for b in bset]))

Buggy submission (verdict: Runtime Error):
n=int(input())
blue=[input() for _ in range(n)]
bset = set(blue)

m=int(input())
red=[input() for _ in range(m)]

print(min(0, max([blue.count(b) - red.count(b)) for b in bset]))
Problem p03424 (python)

Fixed submission:
n = int(input())
arare = set(input().split())
if len(arare) == 3:
    print("Three")
else:
    print("Four")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print("Yes" if a <= c <= b else "No")
Problem p03544 (python)

Fixed submission:
n = int(input())

a, b = 2, 1
for i in range(n):
    a, b = b, a + b
print(a)

Buggy submission (verdict: Runtime Error):
a = 2
b = 1
c = 0
for i in range(2, n + 1):
    c = a + b
    a = b
    b = c
print(c)
Problem p03636 (python)

Fixed submission:
# %% A
h,*b,t = input()
print(h+str(len(b))+t)

Buggy submission (verdict: Runtime Error):
h,*b,t = input()
print(h+str(len(b))+t
Problem p03673 (python)

Fixed submission:
from collections import deque

n = int(input())
aa = list(map(int, input().split()))
bb = deque()
left = True
for a in aa:
    if left:
        bb.append(a)
    else:
        bb.appendleft(a)
    left = not left

if not left:
    bb.reverse()
print(*list(bb))

Buggy submission (verdict: Runtime Error):
from collections import deque

n = int(input())
aa = list(map(int, input().split()))
bb = deque()
left = True
for a in aa:
    if left:
        bb.append(a)
    else:
        bb.appendleft(a)
    left = not left

if left:
    print(*list(bb))
else:
    print(*list(bb).reverse())
Problem p03860 (python)

Fixed submission:
s = input()[8]
print("A"+s+"C")

Buggy submission (verdict: Runtime Error):
v

Buggy submission (verdict: Runtime Error):
s = input()[0]
print("A"+s+"C"
Problem p04030 (python)

Fixed submission:
S = list(input())
stack = []

for s in S:
    if s == "B":
        if len(stack) > 0:
            stack.pop()
    else:
        stack.append(s)

print("".join(stack))

Buggy submission (verdict: Runtime Error):
S = list(input())
stack = []
stack.append(S.pop(0))

for s in S:
    if s == "B":
        if len(stack) > 0:
            stack.pop()
    else:
        stack.append(s)

print("".join(stack)
Problem p04044 (python)

Fixed submission:
n, l = map(int, input().split())
s = sorted([input() for i in range(n)])
print(*s, sep="")

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
a = sorted([input() for i in range(n)])
print(*s, sep="")

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
a = sort([input() for i in range(n)])
print(*s, sep="")
Problem p02748 (python)

Fixed submission:
m=list(map(int, input().split()))
rei=list(map(int, input().split())) 
den=list(map(int, input().split())) 
cou = [0] * m[2]
ans = []
for i in range(m[2]):
	cou[i]=list(map(int, input().split()))
	ans.append(rei[cou[i][0]-1]+den[cou[i][1]-1]-cou[i][2])

ans.append(min(rei)+min(den))
print(min(ans))

Buggy submission (verdict: Runtime Error):
a,b,m=map(int, input().split())
rei=list(map(int, input().split())) 
den=list(map(int, input().split())) 
cou = [0] * m
ans = 100000
for i in range(m):
	cou[i]=list(map(int, input().split()))
	c=rei[cou[i][0]-1]+den[cou[i][1]-1]-cou[i][2]
	if ans>c:
		ans=c
c=min(a)+min(b)
if ans>c:
		ans=c
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,m=map(int, input().split())
rei=list(map(int, input().split())) 
den=list(map(int, input().split())) 
cou = [0] * m
ans = []
for i in range(m):
	cou[i]=list(map(int, input().split()))
	ans.append(rei[cou[i][0]-1]+den[cou[i][1]-1]-cou[i][2])
for i in range(b):
	for j in range(a):
		ans.append(rei[j]+den[i]

Buggy submission (verdict: Runtime Error):
a,b,m=map(int, input().split())
rei=list(map(int, input().split())) 
den=list(map(int, input().split())) 
cou = [0] * m[2]
ans = []
for i in range(m[2]):
	cou[i]=list(map(int, input().split()))
	ans.append(rei[cou[i][0]-1]+den[cou[i][1]-1]-cou[i][2])
for i in range(b):
	for j in range(len(a)):
		ans.append(rei[j]+den[i])
print(min(ans))

Buggy submission (verdict: Runtime Error):
a,b,m=map(int, input().split())
rei=list(map(int, input().split())) 
den=list(map(int, input().split())) 
cou = [0] * m[2]
ans = []
for i in range(m[2]):
	cou[i]=list(map(int, input().split()))
	ans.append(rei[cou[i][0]-1]+den[cou[i][1]-1]-cou[i][2])
for i in range(b):
	for j in range(len(a):
		ans.append(rei[j]+den[i])
print(min(ans))
Problem p02741 (python)

Fixed submission:
import sys

list1=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
for line in sys.stdin:
	print(list1[int(line)-1])

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

Fixed submission:
s=input()
print("x"*len(s))

Buggy submission (verdict: Runtime Error):
s=input()
for i in range(len(s)):
    s[i]="x"
print(s)
Problem p02783 (python)

Fixed submission:
h,a=map(int,input().split())
if h % a ==0:
	print(h // a)
else:
	print((h // a ) + 1)

Buggy submission (verdict: Runtime Error):
h=int(input())
count=0
while  h>1:
	h = h // 2
	count += 1
print(2 ** (count+1) - 1)

Buggy submission (verdict: Runtime Error):
h=int(input())
count=0
while  h>1:
	h = h // 2
	conut += 1
print(2 ** (count+1) - 1)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(int(x) for x in input().split())
a.sort()
s=0
if k <= n:
	print(0)
else:
		s = sum(a[:n-k])
		print(s)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(int(x) for x in input().split())
a.sort(reverse = True)
s=0
if k <= n:
	print(0)
else:
		s = sum(a[:n-k])
		print(s)

Buggy submission (verdict: Runtime Error):
h,j = map(int,input().split())
a = list(int(x) for x in input().split())
if sum(a) < h:
	print('No')
else:
	print('Yes')
Problem p02786 (python)

Fixed submission:
h=int(input())
count=0
while  h>1:
	h = h // 2
	count += 1
print(2 ** (count+1) - 1)

Buggy submission (verdict: Runtime Error):
h=int(input())
count=0
while  h>1:
	h = h // 2
	conut += 1
print(2 ** (count+1) - 1)
Problem p02789 (python)

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

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

Fixed submission:
C=input()
alp=list("abcdefghijklmnopqrstuvwzyz")
x=alp.index(C)
print(alp[x+1])

Buggy submission (verdict: Runtime Error):
C=input()
alp=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
x=alp.index(C)
print(alp[x+1])
Problem p02802 (python)

Fixed submission:
n,m=map(int,input().split())
AC=[0 for _ in range(n)]
WA=[0 for _ in range(n)]
pen=0
for _ in range(m):
    p,s=input().split()
    p=int(p)
    if s=="AC":
        if AC[p-1]==0:
            AC[p-1]=1
            pen += WA[p-1]
        else:
            pass
    else:
        if AC[p-1]==0:
            WA[p-1] +=1
        else:
            pass
print(AC.count(1),pen)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[False]*(n+1)
wa=[0]*(n+1)
pena=0
for i in range(m):
    p,s=input().split()
    p=int(p)
    if s == "AC":
        ac[p] = True
    else:
        if False:
            wa[p] += 1
        else:
            continue
for i in ac:
    if i == True:
        pena += wa[index(i)]

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[0 for _ in range(n)]
wt=[0 for _ in range(n)]
pen=0
for i in range(m):
    p,s=input().split()
    if s=="AC":
        ac.append(int(p))
        pen += wt[int(p)]
    else:
        if int(p) in ac:
            pass
        else:
            wt[int(p)] += 1
            
t_ac=set(ac))
print(len(t_ac),pen)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[0 for _ in range(n)]
wt=[0 for _ in range(n)]
pen=0
for i in range(m):
    p,s=input().split()
    if s=="AC":
        ac.append(p)
        pen += wt[int(p)]
    else:
        if p in ac:
            pass
        else:
            wt[int(p)] += 1
            
t_ac=set(ac))
print(len(t_ac),pen)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[]
wt=[0 for _ in range(n)]
pen=0
for i in range(m):
    p,s=input().split()
    if s=="AC":
        ac.append(p)
        pen += wt[p]
    else:
        if p in ac:
            pass
        else:
            wt[p] += 1
            
t_ac=set(ac)
print(len(t_ac),pen)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[]
wt=[]
pen=0
for i in range(m):
    p,s=input().split()
    if s=="AC":
        ac.append(p)
        pen += wt[p]
    else:
        if p in ac:
            pass
        else:
            wt[p] += 1
            
t_ac=set(ac)
print(len(t_ac),pen)
Problem p02812 (python)

Fixed submission:
n=int(input())
s=input()
cnt=0
if len(s)<= 2:
  pass
else:
  for i in range(len(s)-2):
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
cnt=0
if len(s)<= 2:
  pass
else:
  for i in range(len(s)):
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
cnt=0
for i in range(len(s)):
	if s[i]=='A'and s[i+1]=='B'and s[i+2]=='C':
		cnt += 1
print(cnt)
Problem p02922 (python)

Fixed submission:
a,b=map(int,input().split())
plg=1
cnt =0
while True:
	if plg < b:
		plg += a-1
		cnt += 1
	else:
		break
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
*a,=map(int,input().split())
t_ans =0
for i in range(n):
	t_ans  += 1/a[i]
ans = 1/t_ans
print(ans)
Problem p03000 (python)

Fixed submission:
n,x=map(int,input().split())
*l,=map(int,input().split())
t=[0]
for i in range(n):
    d=l[i]+t[-1]
    t.append(d)
ans=[j for j in t if j <= x]
print(len(ans))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
*l,=map(int,input().split())
cnt=1
d=0
while d <= x:
	d=d+l[cnt-1]
	cnt += 1
print(cnt-1)
Problem p03060 (python)

Fixed submission:
n=int(input())
v=list(int(x) for x in input().split())
c=list(int(y) for y in input().split())
e=[]
for i in range(n):
	if (v[i]-c[i])>0:
		e.append(v[i]-c[i])
ans=sum(e)
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
v=int(x) for x in input().split()
c=int(y) for y in input().split()
e=[i for i in range(n) if (v[i]-c[i])>0]
ans=sum(e)
print(ans)
Problem p03076 (python)

Fixed submission:
m=[]
cnt=0
for i in range(5):
    x=int(input())
    m.append(x)
m10=[i % 10 for i in m if i %10 >=1]
if m10:
    t=min(m10)
    for i in m:
        if i %10==0:
            cnt += i
        else:
            cnt += ((i//10)+1)*10
    print(cnt-10+t)
else:
    print(sum(m))

Buggy submission (verdict: Runtime Error):
m=[]
cnt=0
for i in range(5):
    x=int(input())
    m.append(x)
m10=[i % 10 for i in m if i %10 >=1]
if n10:
    t=min(m10)
    for i in m:
        if i %10==0:
            cnt += i
        else:
            cnt += ((i//10)+1)*10
    print(cnt-10+t)
else:
    print(sum(m))

Buggy submission (verdict: Runtime Error):
m=[]
cnt=0
for i in range(5):
    x=int(input())
    m.append(x)
m10=[i % 10 for i in m if i %10 >=1]
t=min(m10)
for i in m:
    if i %10==0:
        cnt += i
    else:
        cnt += ((i//10)+1)*10
print(cnt-10+t)

Buggy submission (verdict: Runtime Error):
m=[]
cnt=0
for i in range(5):
    x=int(input())
    menu.append(x)
m10=[i % 10 for i in m if i %10 >=1]
t=min(m10)
for i in m:
    if i %10==0:
        cnt += i
    else:
        cnt += ((i//10)+1)*10
print(cnt-10+t)

Buggy submission (verdict: Runtime Error):
m=[]
cnt=0
for i in range(5):
    x=int(input())
    m.append(x)
m10=[i % 10 for i in m if i %10 >=1]
t=min(m10)
for i in m:
    if i %10==0:
        cnt += i
    else:
        cnt += ((i//10)+1)*10
print(cnt-t)

Buggy submission (verdict: Runtime Error):
m=[]
cnt=0
for i in range(5):
    x=int(input())
    menu.append(x)
m10=[i % 10 for i in m if i %10 >=1]
t=min(m10)
for i in m:
    if i %10==0:
        cnt += i
    else:
        cnt += ((i//10)+1)*10
print(cnt-t)
Problem p03086 (python)

Fixed submission:
s=list(input())
d=["A","G","C","T"]
a=[]
b=[]
x=[]
for i in range(len(s)):
    a.append(s[i:])
for j in a:
    for k in range(len(j)-1):
        b.append(j[:-k-1])
ans=a+b
for i in ans:
    if set(i) <= set(d):
        x.append(len(i))
    else:
        pass
if x:
  print(max(x))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
s=list(input())
d=["A","G","C","T"]
a=[]
b=[]
x=[]
for i in range(len(s)):
    a.append(s[i:])
for j in a:
    for k in range(len(j)-1):
        b.append(j[:-k-1])
ans=a+b
for i in ans:
    if list(set(i)) == d:
        x.append(len(i))
    else:
        pass
print(max(x))
Problem p03087 (python)

Fixed submission:
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
L=[0]
c=0
for i in range(n-1):
	if s[i]=='A' and s[i+1]=='C':
		c += 1
	L.append(c)
for l,r in lr:
	print(L[r-1]-L[l-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
L=[0]
c=0
for i in range(n-1):
	if s[i]=='A' and s[i+1]=='C':
		c += 1
	L.append(c)
for l,r in lr:
	print(L[r]-L[l])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
L=[0,0]
c=0
for i in range(1,n+1):
	if s[i-1]=='A' and s[i]=='C':
		c += 1
	L.append(c)
print(L)
for l,r in lr:
	print(L[r]-L[l])
Problem p03220 (python)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
*h,=map(int,input().split())
tmp=[]
for i in h:
	tmp.append(t-i*0.006)
tmp_abs=[abs(j-a) for j in tmp]
print(tmp_abs.index(min(tmp_abs))+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
*h,=map(int,input().split())
tmp=[]
for i in h:
	tmp.append(t-h*0.006)
tmp_abs=[abs(j-a) for j in tmp]
print(tmp_abs.index(min(tmp_abs))+1)

Buggy submission (verdict: Runtime Error):
s=input()
d=[]
for i in range(len(s)-2):
	d.append(int(s[i:i+3]))
ans=[abs(j-753) for j in d]
print(min(ans))
Problem p03244 (python)

Fixed submission:
from collections import Counter
n=int(input())
*v,=map(int,input().split())
odd=Counter(v[::2]).most_common()
odd.append((0,0))
even=Counter(v[1::2]).most_common()
even.append((0,0))
if odd[0][0]==even[0][0]:
    ans=min(n-odd[0][1]-even[1][1],n-odd[1][1]-even[0][1])
else:
    ans=n-odd[0][1]-even[0][1]
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n=int(input())
*v,=map(int,input().split())
if n==2 and len(set(v))==2:
    print(0)
    exit(0)
elif all(v[i]==v[i+2] for i in range(n-2)) and v[0]!=v[1]:
    print(0)
    exit(0)
odd=v[1::2]
odd_c=Counter(odd).most_common()[0][1]
even=v[::2]
even_c=Counter(even).most_common()[0][1]
cnt=0
if Counter(odd).most_common()[0][0]==Counter(even).most_common()[0][0]:
    if odd_c<even_c:
        odd_c=Counter(odd).most_common()[1][1]
    else:
        even_c=Counter(even).most_common()[1][1]
print(n-even_c-odd_c)
Problem p03273 (python)

Fixed submission:
h,w=map(int,input().split())
l=[list(input()) for _ in range(h)]
l=[x for x in l if '#' in x]
l=[x for x in zip(*l) if '#' in x]
for i in zip(*l):
	print(''.join(i))

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
l=[list(input()) for _ in range(w)]
l=[x for x in l if '#' in x]
l=[x for x in zip(*l) if '#' in x]
for i in zip(*l):
	print(''.join(i))
Problem p03281 (python)

Fixed submission:
n=int(input())
p=[3,5,7,11,13]
x=[]
for i in range(5):
	for j in range(i):
		for k in range(j):
			if n >= p[i]*p[j]*p[k]:
				x.append(i*j*k)
cnt=len(x)
if 135 <= n < 189:
	cnt += 1
elif 189 <= n:
	cnt += 2
else:
	pass
print(cnt)

Buggy submission (verdict: Runtime Error):
prime=[3,5,7,11,13]
x=[]
for i in range(5):
	for j in range(i):
		for k in range(j):
			if n >= i*j*k:
				x.append(i*j*k)
cnt=len(x)
if 189> n >= 135:
	cnt += 1
elif n >= 189:
	cnt += 2
else:
	pass
print(cnt)