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

Fixed submission:
s = input()
flag = True
for i in range(len(s)):
    if (i % 2 == 0 and s[i] == 'L') or (i % 2 == 1 and s[i] == 'R'):
        flag = False
if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s=input()
flag = True
for i in range(len(s)):
  if (i % 2 == 0 and s[i] == 'L') or (i % 2 == 1 and s[i] == 'R')
    flag = False
if flag:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
flag = True
for i in range(n):
  if (i % 2 == 0 and s[i] == 'L') or (i % 2 == 1 and s[i] == 'R')
    flag = False
if flag:
  print("Yes")
else:
  print("No")
Problem p02946 (python)

Fixed submission:
k, x = map(int, input().split())
i = max(-1000000, x - k + 1)
while i <= min(1000000, x + k - 1):
  print(i, end=" ")
  i += 1

Buggy submission (verdict: Runtime Error):
k, x = map(int, input().split())
i = max(−1000000, x - k + 1)
while i <= min(1000000, x + k - 1):
  print(i, end=" ")
  i += 1
Problem p03567 (python)

Fixed submission:
print "Yes" if raw_input().count("AC") else "No"

Buggy submission (verdict: Runtime Error):
s=input()
print "Yes" if s.count("AC") else "No"
Problem p02756 (python)

Fixed submission:
S,f=__import__('collections').deque(input()),0
for _ in range(int(input())):
	T=input()
	if T<'2':f=1-f
	else:(S.appendleft if (T[2]<'2')^f else S.append)(T[4])
if f:S.reverse()
print(*S,sep='')

Buggy submission (verdict: Runtime Error):
S,f=__import__('collections').deque(input()),0
for _ in range(int(input())):
	T=input()
	if'2'>T:f=1-f
	else:S.insert(0 if(T[2]<'2')^f else len(S),T[4])
if f:S.reverse()
print(*S,sep='')

Buggy submission (verdict: Runtime Error):
S,f=__import__('collections').deque(input()),0
for _ in range(int(input())):
	T=input()
	if'2'>T:f=1-f
	else:S.insert(0if(T[2]<'2')^f else len(S),T[4])
if f:S.reverse()
print(*S,sep='')
Problem p02936 (python)

Fixed submission:
i=lambda:map(int,input().split())
N,Q=i()
adj=[[] for _ in range(N)]
for _ in range(N-1):
  a,b=i()
  adj[a-1].append(b-1)
  adj[b-1].append(a-1)
V = [0 for _ in range(N)]
for _ in range(Q):
  p,x=i()
  V[p-1]+=x
par = [-1 for _ in range(N)]
q = [0]
for cur in q:
  if par[cur] != -1: V[cur] += V[par[cur]]
  for nxt in adj[cur]:
    if nxt == par[cur]: continue
    par[nxt] = cur
    q.append(nxt)
print(' '.join(map(str, V)))

Buggy submission (verdict: Runtime Error):
i=lambda:map(int,input().split())
N,Q=i()
adj=[[] for _ in range(N)]
for _ in range(N-1):
  a,b=i()
  adj[a-1].append(b-1)
  adj[b-1].append(a-1)
V = [0 for _ in range(N)]
for _ in range(Q):
  p,x=i()
  V[p-1]+=x
def dfs(cur, prv):
  for nxt in adj[cur]:
    if nxt == prv: continue
    V[nxt] += V[cur]
    dfs(nxt, cur)
dfs(0,-1)
print(' '.join(map(str, V)))
Problem p02937 (python)

Fixed submission:
s,t=([ord(c)-ord('a') for c in input()]for _ in'xx')
if set(t)-set(s):
  print(-1)
else:
  u=s+s
  nxt = [None for _ in range(len(u)+1)]
  nxt[len(u)]=[0 for _ in range(26)]
  for i in range(len(u)-1,-1,-1):
    nxt[i] = [v+1 for v in nxt[i+1]]
    nxt[i][u[i]]=0
  p = 0
  for c in t:
    p += nxt[p%len(s)][c]+1
  print(p)

Buggy submission (verdict: Runtime Error):
s,t=([chr(c)-chr('a') for c in input()]for _ in'xx')
if set(t)-set(s):
  print(-1)
else:
  u=s+s
  nxt = [None for _ in range(len(u)+1)]
  nxt[len(u)]=[0 for _ in range(26)]
  for i in range(len(u)-1,-1,-1):
    nxt[i] = [v+1 for v in nxt[i+1]]
    nxt[i][u[i]]=0
  p = 0
  for c in t:
    p += nxt[p%len(s)][c]+1
  print(p)
Problem p03325 (python)

Fixed submission:
input()
def f(a):
  a = int(a)
  r = 0
  while a % 2 == 0:
    a /= 2
    r += 1
  return r
print(sum(map(f, input().split())))

Buggy submission (verdict: Runtime Error):
input()
def f(a):
  a = int(a)
  r = 0
  while a % 2 == 0:
    a /= 2
    r += 1
  return r
print(sum(map(f,input.split())))
Problem p02911 (python)

Fixed submission:
import numpy as np
n, k, q = input().split(' ')
n, k, q = int(n),int(k), int(q)
hum = [k]*n
for i in range(q):
    ind = input()
    hum[int(ind)-1] += 1
hum_last = np.array(hum)-q
for i in range(len(hum_last)):
    if hum_last[i] <= 0:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k, q = input().split(' ')
n, k, q = int(n),int(k), int(q)
hum = [k]*n
for i in range(q):
    ind = input()
    hum[int(ind)] += 1
hum_last = np.array(hum)-q
for i in range(len(hum_last)):
    if hum_last[len(hum_last)-i-1] <= 0:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k, q = input().split(' ')
n, k, q = int(n),int(k), int(q)
hum = [0]*n
for i in range(q):
    ind = input()
    hum[int(ind)] += 1
hum_last = np.array(hum)-q
for i in range(len(list(hum_last))):
    if hum_last[i] <= 0:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k, q = input().split(' ')
n, k, q = int(n),int(k), int(q)
hum = [0]*n
for i in range(q):
    ind = input()
    hum[int(ind)] += 1
hum_last = np.array(hum)-1
for i in range(len(list(hum_last))):
    if hum_last[i] <= 0:
        print('No')
    else:
        print('Yes')

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

n, k, q = input().split(' ')
n, k, q = int(n),int(k), int(q)
hum = [0]*n
for i in range(q):
    ind = input()
    hum[int(ind)] += 1
hum_last = np.array(hum)-1
for i in range(len(hum_last)):
    if hum_last[i] <= 0:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k, q = input().split(' ')
n, k, q = int(n),int(k), int(q)
hum = [0]*n
for i in range(q):
    ind = input()
    hum[int(ind)] += 1
hum_last = np.array(hum)-1
for i in range(len(hum_last)):
    if hum_last[len(hum_last)-1-i] <= 0:
        print('No')
    else:
        print('Yes')
Problem p02946 (python)

Fixed submission:
k, x = input().split(' ')
k, x = int(k), int(x)   
arr = []
         
for i in range(k): 
  arr.append(x-i)
  arr.append(x+i)
arr = list(set(arr))
arr.sort()
text = ""
for i in range(len(arr) - 1):
  text += str(arr[i]) + " "
print(text + str(arr[len(arr) - 1]))

Buggy submission (verdict: Runtime Error):
k, x = input().split(' ')
k, x = int(k), int(x)   
arr = []
     
for i in range(k): 
 arr.append(x-i)
 arr.append(x+i)
arr = list(set(arr))
arr.sort()
text = ""
for i in range(len(arr) - 1):
  text += arr[i] + " "
print(text + arr[len(arr) - 1])
Problem p03005 (python)

Fixed submission:
n, k = input().split(' ')
n, k = int(n), int(k)
maxval = 1
if k == 1:
    print(0)
else:
    while n - maxval - k + 1 != 0:
        maxval += 1
    print(maxval - 1)

Buggy submission (verdict: Runtime Error):
n = input()
n = int(n)
num = []*n
numint = []
num = input().split(' ')
for i in range(len(num)):
    numint.append(int(num[i]))
i = 0
x, y = int, int
word = []

numint = sorted(numint)
x = numint[0]
y = numint[1]
word.append(str(x) + " " + str(y))
numint.append(x - y)
numint.pop(0)
numint.pop(0)
while len(numint) > 2:
    numint = sorted(numint)
    x = numint[0]
    y = numint[1]
    if x < y:
        a, b = x, y
        x, y = b,a
    word.append(str(x) + " " + str(y))
    numint.append(x - y)
    numint.pop(0)
    numint.pop(0)
print(numint[0])
for i in range(len(word)):
    print(word[i])

Buggy submission (verdict: Runtime Error):
n = input()
n = int(n)
num = []*n
numint = []
num = input().split(' ')
for i in range(len(num)):
    numint.append(int(num[i]))
i = 0
x, y = int, int
word = []

numint = sorted(numint)
x = numint[0]
y = numint[1]
word.append(str(x) + " " + str(y))
numint.append(x - y)
numint.pop(0)
numint.pop(0)
while len(numint) > 2:
    numint = sorted(numint)
    x = numint[0]
    y = numint[1]
    if x < y:
        a, b = x, y
        x, y = b,a
    word.append(str(x) + " " + str(y))
    numint.append(x - y)
    numint.pop(0)
    numint.pop(0)
print(numint[0])
for i in range(len(word)):
    print(word[i])

Buggy submission (verdict: Runtime Error):
n = input()
n = int(n)
num = []*n
numint = []
num = input().split(' ')
for i in range(len(num)):
    numint.append(int(num[i]))
i = 0
x, y = int, int
word = []

numint = sorted(numint)
x = numint[0]
y = numint[1]
word.append(str(x) + " " + str(y))
numint.append(x - y)
numint.pop(0)
numint.pop(0)
while len(numint) > 1:
    numint = sorted(numint)
    x = numint[0]
    y = numint[1]
    if x < y:
        a, b = x, y
        x, y = b,a
    word.append(str(x) + " " + str(y))
    numint.append(x - y)
    numint.pop(0)
    numint.pop(0)
print(numint[0])
for i in range(len(word)):
    print(word[i])

Buggy submission (verdict: Runtime Error):
n = input()
n = int(n)
num = []*n
numint = []
num = input().split(' ')
for i in range(len(num)):
    numint.append(int(num[i]))
i = 0
x, y = int, int
word = []

numint = sorted(numint)
x = numint[0]
y = numint[1]
word.append(str(x) + " " + str(y))
numint.append(x - y)
numint.pop(0)
numint.pop(0)
while len(numint) > 1:
    numint = sorted(numint)
    x = numint[0]
    y = numint[1]
    if x < y:
        a, b = x, y
        x, y = b,a
    word.append(str(x) + " " + str(y))
    numint.append(x - y)
    numint.pop(0)
    numint.pop(0)
print(numint[0])
for i in range(len(word)):
    print(word[i])

Buggy submission (verdict: Runtime Error):
n, k = input.split(' ')
n, k = int(n), int(k)
maxval = k - n
minval = k / n
print(maxval - minval)
Problem p03962 (python)

Fixed submission:
import math
from string import ascii_lowercase
 
line = input()
a, b, c = [int(x) for x in line.split()]
 
d = set((a, b, c))
print(len(d))

Buggy submission (verdict: Runtime Error):
import math
from string import ascii_lowercase

a = int(input())
b = int(input())
c = int(input())

d = set((a, b, c))
print(len(d))
Problem p02923 (python)

Fixed submission:
N=int(input())
H=list(map(int, input().split()))
cnt=0
mcnt=0
for i in range(N-1):
    if H[i]>=H[i+1]:
        cnt+=1
        if mcnt<cnt:
            mcnt=cnt
    else:
        cnt=0
print(mcnt)

Buggy submission (verdict: Runtime Error):
cnt=0
mcnt=0
for i in range(N-1):
    if H[i]>=H[i+1]:
        cnt+=1
        if mcnt<cnt:
            mcnt=cnt
    else:
        cnt=0
Problem p03086 (python)

Fixed submission:
S=list(input())
max=0
count=0
for i in range(len(S)):
  if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
    count+=1
    if max<count:
      max=count
  else:
    count=0
print(max)

Buggy submission (verdict: Runtime Error):
S=input()
max=0
count=0
for i in range(len(S)):
  if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
    count+=1
    if max<count:
    max=count
  else:
    count=0
print(max)

Buggy submission (verdict: Runtime Error):
S=input()
max=0
count=0
for i in range(len(S)):
  if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
    count+=1
    if max<count:
    max=count
  else:
    count=0
print(max)

Buggy submission (verdict: Runtime Error):
S=input()
max=0
count=0
for i in range(len(S)):
  if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
    count+=1
    if max<count:
    max=count
  else:
    count=0
print(count)
Problem p03109 (python)

Fixed submission:
N=int(input().replace('/',''))
if N <= 20190430:
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):
N=int(input())
xu=[list(map(str, input().split())) for _ in range(N)]
total=0
for i in range(N):
    if xu[i][1]=='JPY':
        total+=float(xu[i][0])
    else:
        total+=380000.0*float(xu[i][0])
Problem p03238 (python)

Fixed submission:
N=int(input())
if N==1:
    print('Hello World')
if N==2:
    A=int(input())
    B=int(input())
    print(A+B)

Buggy submission (verdict: Runtime Error):
N=int(input())
xyh=[list(map(int,input().split())) for i in range(N)]
MAX=100
for PosY in range(MAX+1):
    for PosX in range(MAX+1):
        needH=-1
        for i in range(N):
             if xyh[i][2]>0:
                tmp=xyh[i][2]+abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH==-1:
                    needH=tmp
                else:
                    if needH!=tmp:
                        needH=-2
                        break
        if needH==-2:
            continue
        for i in range(N):
            if xyh[i][2]==0:
                dist=abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH>dist:
                    needH=-2
                    break
        if needH==-2:
            continue
        print(PosX,PosY,needH)
Problem p03240 (python)

Fixed submission:
N=int(input())
xyh=[list(map(int,input().split())) for i in range(N)]
MAX=100
for PosY in range(MAX+1):
    for PosX in range(MAX+1):
        needH=-1
        for i in range(N):
             if xyh[i][2]>0:
                tmp=xyh[i][2]+abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH==-1:
                    needH=tmp
                else:
                    if needH!=tmp:
                        needH=-2
                        break
        if needH==-2:
            continue
        for i in range(N):
            if xyh[i][2]==0:
                dist=abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH>dist:
                    needH=-2
                    break
        if needH==-2:
            continue
        print(PosX,PosY,needH)

Buggy submission (verdict: Runtime Error):
MAX=100
for PosY in range(MAX+1):
    for PosX in range(MAX+1):
        needH=-1
        for i in range(N):
            tmp=xyh[i][2]+abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
            if needH==-1:
                needH=tmp
            else:
                if needH!=tmp:
                    needH=-2
                    break
        if needH==-2:
            continue
        for i in range(N):
            if xyh[i][2]==0:
                dist=abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH>dist:
                    needH=-2
                    break
        if needH==-2:
            continue
        print(PosX,PosY,needH)
Problem p03244 (python)

Fixed submission:
n = int(input())
A = [int(x) for x in input().split()]

from collections import Counter
import operator
def f():
    a = Counter(A[::2]).most_common(2)
    b = Counter(A[1::2]).most_common(2)
    ac, bc = a[0][1], b[0][1]
    ret = n - (ac + bc)
    if a[0][0] == b[0][0]:
        bc_2 = b[1][1] if len(b) != 1 else 0
        ac_2 = a[1][1] if len(a) != 1 else 0
        ret = n - max(ac + bc_2, ac_2 + bc)
    return ret
print(f())

Buggy submission (verdict: Runtime Error):
n=int(input())
v=list(map(int,input().split()))
even=v[0::2]
odd=v[1::2]
import collections
c=collections.Counter(even)
d=collections.Counter(odd)
e=c.most_common()[0][0]
o=d.most_common()[0][0]
e2=c.most_common()[0][1]
o2=d.most_common()[0][1]
if e==o:
  	if even.count(e)==odd.count(o)==len(even):
        print(n/2)
    elif even.count(e)>odd.count(o):
        o=o2
    else:
        e=e2
count=len(v)-(even.count(e)+odd.count(o))
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
N=list(map(int,input().split()))
even=[]
odd=[]
for i in range(len(N)):
    if i%2==0:
        even.append(N[i])
    if i%2==1:
        odd.append(N[i])
import collections
c = collections.Counter(even)
x=c.most_common()[0][0]
o=even.count(x)
d= collections.Counter(odd)
y=d.most_common()[0][0]
p=odd.count(y)
s=len(even)-even.count(x)
t=len(odd)-odd.count(y)
if x!=y and o==len(even) and p==len(odd):
    print(0)
elif x==y and o==len(even) and p==len(odd):
    print(n/2)
elif x==y and (o!=len(even) or p!=len(odd)):
    if o>p:
        y=d.most_common()[1][0]
        s=len(even)-even.count(x)
        t=len(odd)-odd.count(y)
        print(s+t)
    else:
        x=c.most_common()[1][0]
        s=len(even)-even.count(x)
        t=len(odd)-odd.count(y)
        print(s+t)
elif:
    print(s+t)
Problem p03262 (python)

Fixed submission:
N,X=map(int,input().split())
x=list(map(int,input().split()))
absx=[]
for i in range(len(x)):
    absx.append(abs(x[i]-X))
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)
print(gcd_list(absx))

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
x=list(map(int,input().split()))
absx=[]
for i in range(len(x)):
    absx.append(abs(x[i]-X))
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(absx))
Problem p03282 (python)

Fixed submission:
S=list(input())
K=int(input())
count=0
for i in range(len(S)):
    if S[i]=='1':
         count+=1
    else:
        break
if K<=count:
    print(1)
else:
    print(S[count])

Buggy submission (verdict: Runtime Error):
S=list(input())
K=int(input())
count=0
for i in range(len(S)):
    if S[i]=='1':
         count+=1
    else:
        break
if K<=count:
    print(1)
else:
    print(S[1])

Buggy submission (verdict: Runtime Error):
S=list(input().split())
K=int(input())
count=0
for i in range(len(S)):
    if S[i]=='1':
         count+=1
    else:
        break
if K<=count:
    print(1)
else:
    print(S[1])
Problem p03292 (python)

Fixed submission:
a = [int(i) for i in input().split()]
a.sort()
print(a[2]-a[0])

Buggy submission (verdict: Runtime Error):
a=[int() for i in range(input().split())]
a.sort()
print(a[2]-a[0])
Problem p03328 (python)

Fixed submission:
a,b=map(int,input().split())
n=b-a-1
h=n*(n+1)/2
print(int(h-a))

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

Fixed submission:
a, b, c, d = map(int, input().split())
ans="No"
ab=a-b
if ab<0:
    ab=-ab
bc=b-c
if bc<0:
    bc=-bc
ac=a-c
if ac<0:
    ac=-ac
if (ab<=d and bc<=d)or (ac<=d):
    ans="Yes"
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
X=int(input())
Y=int(np.sqrt(X))+1
max=1
for j in range(2,Y+1):
    for i in range(1,Y+1):
        if i**j<=X and i**j>max:
            max=i**j
print(max)

Buggy submission (verdict: Runtime Error):
import numpy as np
X=int(input())
Y=int(np.sqrt(X))+1
max=1
for j in range(2,Y+1):
    for i in range(1,Y+1):
        if i**j<=X and i**j>max:
            max=i**j
print(max)

Buggy submission (verdict: Runtime Error):
import math
X=int(input())
Y=int(math.sqr(X))+1
max=1
for j in range(2,Y+1):
    for i in range(1,Y+1):
        if i**j<=X and i**j>max:
            max=i**j
print(max)
Problem p03359 (python)

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

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
r = "Yes"
for i in range(1, h-1):
    for j in range(1, w-1):
        if s[i][j] == "#" and s[i - 1][j] == "." and s[i + 1][j] == "." and s[i][j - 1] == "." and s[i][j + 1] == ".":
          r = "No"
print(r)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
k=int(input())
m=max(A,B,C)
print(A+B+C-m+m*2**k)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
print(a)
count=0
for i in range(a-1):
    count+=1
if a<b:
    count+=1
print(count)
Problem p03385 (python)

Fixed submission:
print("Yes"  if ''.join(sorted(list(input()))) == "abc" else "No")

Buggy submission (verdict: Runtime Error):
a,b,k = list(map(int, input().split()))
for i in range(a, min(a+k, b+1)):
  print(i)
for i in range(max(a+k,b-k+1),b+1):
  print(i)
Problem p03399 (python)

Fixed submission:
print(min(int(input()),int(input()))+min(int(input()),int(input())))

Buggy submission (verdict: Runtime Error):
N=int(input())
D,X=map(int,input().split())
A=[int(input()) for i in range(N)]
sum=0
for i in range(len(A)):
    n=1
    while 1+(n-1)*A[i]<=D:
        sum+=1
        n+=1
    print(sum)
print(sum+X)
    
N=int(input())
D,X=map(int,input().split())
A=[int(input()) for i in range(N)]
sum=0
for i in range(len(A)):
    n=1
    while 1+(n-1)*A[i]<=D:
        sum+=1
        n+=1
print(sum+X)
Problem p03477 (python)

Fixed submission:
A,B,C,D=map(int,input().split())
if A+B>C+D:
    print("Left")
elif A+B==C+D:
    print("Balanced")
else:
    print("Right")

Buggy submission (verdict: Runtime Error):
if A+B>C+D:
    print("Left")
elif A+B==C+D:
    print("Balanced")
else:
    print("Right")
Problem p03494 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
cnt = 0
 
while True:
    for i in range(len(A)):
        if A[i]%2 != 0:
            break
        elif A[i]%2 == 0:
            A[i] /= 2
    else:
        cnt += 1
        continue
    break
    
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(input().split())
num=int(A[0])
while num%2!=1 and num>0:
    num=num/2
    cnt+=1
mini=cnt
for i in range(N):
    cnt=0
    num=int(A[i])
    while num%2!=1 and num>0:
        num=num/2
        cnt+=1
    if cnt<mini:
        mini=cnt
print(mini)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(input().split())
num=int(A[0])
while num%2!=1 and num>0:
    num=num/2
    cnt+=1
mini=cnt
for i in range(N):
    cnt=0
    num=int(A[i])
    while num%2!=1 and num>0:
        num=num/2
        cnt+=1
    if cnt<mini:
        mini=cnt
print(mini)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(input().split())
num=int(A[0])
while num%2!=1 and num>0:
    num=num/2
    cnt+=1
mini=cnt
for i in range(N):
    cnt=0
    num=int(A[i])
    while num%2!=1 and num>0:
        num=num/2
        cnt+=1
    if cnt<mini:
        mini=cnt
print(mini)
Problem p03598 (python)

Fixed submission:
N=int(input())
K=int(input()) 
S=list(map(int, input().split()))
total=0
for i in range(N):
    if abs(S[i]-K)<S[i]:
        total+=abs(S[i]-K)*2
    else:
        total+=2*S[i]
print(total)

Buggy submission (verdict: Runtime Error):
N=int(input())
K=int(input()) 
S=list(map(int, input().split()))
total=0
for i in range(A):
    if abs(S[i]-K)<S[i]:
        total+=abs(S[i]-K)*2
    else:
        total+=2*S[i]
print(total)

Buggy submission (verdict: Runtime Error):
N=int(input())
K=int(input()) 
S=list(map(int, input().split()))
total=0
for i in range(A):
    if abs(S[i]-K)<S[i]:
        total+=abs(S[i]-K)*2
    else:
        total+=2*S[i]
Problem p03693 (python)

Fixed submission:
r,g,b=input().split()
x=int(r+g+b)

if x%4==0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
r,g,b=map(int,input().split())
x=int(r+g+b)
if x%4==0:
  print('YES')
else:
  print('NO')
r,g,b=map(int,input().spklit())
x=int(r+g+b)
if x%4==0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
r,g,b=map(int,input().spklit())
x=int(r+g+b)
if x%4==0:
  print('YES')
else:
  print('NO')
Problem p03720 (python)

Fixed submission:
N,M=map(int,input().split())
S=[list(map(int,input().split())) for i in range(M)]
c=[0]*N
for i in range(M):
    for j in range(2):
        c[S[i][j]-1]+=1
for i  in range(N):
    print(c[i])

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
S=[list(map(int,input().split())) for i in range(M)]
for i in range(M):
    S[i].sort()
    for j in range(2):
        S[i][j]=str(S[i][j])
    S[i]=''.join(S[i])
S=list(set(S))
R=[0]*N
for i in range(N):
    n=i+1
    for j in range(M):
        for k in range(2):
            if S[j][k]==str(n):
                R[i]+=1
for i in range(N):
    print(R[i])
Problem p02705 (python)

Fixed submission:
print(6.28 * int(input()))

Buggy submission (verdict: Runtime Error):
print(6.28 * int(input())
Problem p03455 (python)

Fixed submission:
l = [int(x) for x in raw_input().split()]
print "Even" if l[0]*l[1]%2 == 0 else "Odd"

Buggy submission (verdict: Runtime Error):
l = [int(x) for x in raw_input().split()]
print "Even" if l[0]*l[i]%2 == 0 else "Odd"
Problem p03697 (python)

Fixed submission:
a, b = (int(x) for x in raw_input().split())
print "error" if a + b > 9 else str(a+b)

Buggy submission (verdict: Runtime Error):
a, b = (int(x) for x in raw_input().split)
print "error" if a + b > 9 else str(a+b)
Problem p03970 (python)

Fixed submission:
a = "CODEFESTIVAL2016"
b = raw_input()
r = 0
for i in xrange(len(a)):
	if a[i] != b[i]:
		r += 1
print r

Buggy submission (verdict: Runtime Error):
a = "REMEMBER TO PUT AC/WA ONLY"
b = raw_input()
r = 0
for i in xrange(len(a)):
	if a[i] != b[i]:
		r += 1
print r
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = input().split()
A = int(a)
B - int(b)
print(A*B)