Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x = int(input())

b = 1
p = 2
m = 0

def check(b, p, m):
    if b**p >= m  and b**p <= x:
        print(f"{b}**{p}={b**p}")
        return b**p
    else:
        return m

if x == 1:
    print(1)
else:
    for b in range(x):
        for p in range(x-1):
            m = check(b+1, p+2, m)
    print(m)

Fixed submission:
x = int(input())

m = 0
b = 1
p = 2
ls = []

if x in (1,2,3):
    print(1)
else:
    while b <= x:
        p = 2
        while p <= x:
            if  b**p <= x:
                # print(f"{b}**{p}={b**p}")
                ls.append(b**p)
                p += 1
            else:
                # print(f"break{b}**{p}={b**p}, m{m}")
                break
        b += 1
    print(max(ls))

Buggy python submission (verdict: Runtime Error):
x = int(input())

b = 1
p = 2
m = 0

def check(b, p, m):
    if b**p >= m  and b**p <= x:
        print(f"{b}**{p}={b**p}")
        return b**p
    else:
        return m

if x = 1:
    print(1)
else:
    for b in range(x):
        for p in range(x-1):
            m = check(b+1, p+2, m)
    print(m)

Fixed submission:
x = int(input())

m = 0
b = 1
p = 2
ls = []

if x in (1,2,3):
    print(1)
else:
    while b <= x:
        p = 2
        while p <= x:
            if  b**p <= x:
                # print(f"{b}**{p}={b**p}")
                ls.append(b**p)
                p += 1
            else:
                # print(f"break{b}**{p}={b**p}, m{m}")
                break
        b += 1
    print(max(ls))
Buggy python submission (verdict: Runtime Error):
a, b, c, x, y= map(int, input().split())

price = []
for i in range(10**5):
    price.append(i * 2*c + max(0,x-i) * a + max(0,y-i) * b)
print(min(price))

Fixed submission:
S = input()
Ss = [S[0],S[1],S[2]]
Ss_extract = [x for x in Ss if x == "o"]
print(700 + len(Ss_extract)*100)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, x, y= map(int, input().split())
# a, b, c, x, y = 1500, 2000, 1600, 3, 2

price = []
for i in range(10000000):
    price.append(i * 2*c + max(0,x-i) * a + max(0,y-i) * b)

print(min(price))

Fixed submission:
a, b, c, x, y= map(int, input().split())

price = []
for i in range(10**5+1):
    price.append(i * 2*c + max(0,x-i) * a + max(0,y-i) * b)
print(min(price))
Buggy python submission (verdict: Runtime Error):
if x >= a and x-a <= b:
    print("YES")
else:
    print("NO")

Fixed submission:
a, b, x = map(int, input().split())
if x >= a and x-a <= b:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n, map(int, input())
ls = set(map(int, input().split()))
sorted_ls.sort()
f = sorted_ls[int(n/2)]
b = sorted_ls[int(n/2)-1]

for i in range(n):
    if i > n/2:
        print(f)
    else:
        print(b)
    

Fixed submission:
n =  int(input())
ls = list(map(int, input().split()))
sorted_ls = ls.copy()
sorted_ls.sort()
f = sorted_ls[int(n/2)]
b = sorted_ls[int(n/2)-1]

for i in ls:
    if i < f:
        print(f)
    else:
        print(b)

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

for i in range(len(ls)):
    ls2 = ls.copy()
    ls2.remove(ls[i])
    print(sorted(ls2)[1])


Fixed submission:
n =  int(input())
ls = list(map(int, input().split()))
sorted_ls = ls.copy()
sorted_ls.sort()
f = sorted_ls[int(n/2)]
b = sorted_ls[int(n/2)-1]

for i in ls:
    if i < f:
        print(f)
    else:
        print(b)

Buggy python submission (verdict: Runtime Error):
n = map(int, input().split())
ls = list(map(int, input().split))
for i in ls:
    ls2 = ls.copy()
    ls2.remove(i)
    print(sorted(ls2)[1])

Fixed submission:
n =  int(input())
ls = list(map(int, input().split()))
sorted_ls = ls.copy()
sorted_ls.sort()
f = sorted_ls[int(n/2)]
b = sorted_ls[int(n/2)-1]

for i in ls:
    if i < f:
        print(f)
    else:
        print(b)
Buggy python submission (verdict: Runtime Error):
S = input()
if len(set((S[0], S[1], S[2]))) == 3:
    print("Yes")
else:
    pritn("No")


Fixed submission:
S = input()
if len(set((S[0], S[1], S[2]))) == 3:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
print(S[0])
if len(set((S[0], S[1], S[2]))) == 3:
    print("Yes")
else:
    pritn("No")



Fixed submission:
S = input()
if len(set((S[0], S[1], S[2]))) == 3:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
if len(set(S[0], S[1], S[2])) == 3:
    print("Yes")
else:
    pritn("No")


Fixed submission:
S = input()
if len(set((S[0], S[1], S[2]))) == 3:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
for x in (list(range(a, a+k)) + list(range(b-k, b))):
    print(x)

Fixed submission:
a, b, k = map(int, input().split())
if b - a - 2*k + 1 > 0:
    for x in (list(range(a, a+k)) + list(range(b-k+1, b+1))):
        print(x)
else:
    for x in (range(a, b+1)):
        print(x)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for x in range(a, b+1):
    if x < a+k or x > b-k:
        print(x)

Fixed submission:
a, b, k = map(int, input().split())
if b - a - 2*k + 1 > 0:
    for x in (list(range(a, a+k)) + list(range(b-k+1, b+1))):
        print(x)
else:
    for x in (range(a, b+1)):
        print(x)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
d = input()
print(min(int(a),int(b)) + min(int(c),int(d))

Fixed submission:
a = input()
b = input()
c = input()
d = input()
print(min(int(a),int(b)) + min(int(c),int(d)))

Buggy python submission (verdict: Runtime Error):
a = map(int, input())
b = map(int, input())
c = map(int, input())
d = map(int, input())
print(min(a,b) + min(c,d))

Fixed submission:
a = input()
b = input()
c = input()
d = input()
print(min(int(a),int(b)) + min(int(c),int(d)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
d, x= map(int, input().split())
a = []
for i in range(n):
    a.append(int(input()))
c = n+x

for A in a:
    choco += int((d-1)/A)
print(c)
        



Fixed submission:
n = int(input())
d, x= map(int, input().split())
a = []
for i in range(n):
    a.append(int(input()))
c = n+x

for A in a:
    c += int((d-1)/A)
print(c)

Buggy python submission (verdict: Runtime Error):
n = int(input())
d, x= map(int, input().split())
a = []
for i in range(n):
    a.append(int(input()))

c = n+x
for A in a:
    choco += int((d-1)/A)
print(c)
        



Fixed submission:
n = int(input())
d, x= map(int, input().split())
a = []
for i in range(n):
    a.append(int(input()))
c = n+x

for A in a:
    c += int((d-1)/A)
print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
X = map(int, input().split())
# n = 3
# X = [3, 5, -1]

X.insert(0,0)
X.append(0)
Y = []
for i, x in enumerate(X[1:]):
    Y.append(abs(x-X[i]))
sumY = sum(Y)

for i, x in enumerate(X):
    if i not in [0,len(X)-1]:
        ans = sumY - (Y[i-1] + Y[i]) + abs(X[i+1]-X[i-1])
        print(ans)

Fixed submission:
n = int(input())
X = map(int, input().split())
X = list(X)
# n = 3
# X = [3, 5, -1]

X.insert(0,0)
X.append(0)
Y = []
for i, x in enumerate(X[1:]):
    Y.append(abs(x-X[i]))
sumY = sum(Y)

for i, x in enumerate(X):
    if i not in [0,len(X)-1]:
        ans = sumY - (Y[i-1] + Y[i]) + abs(X[i+1]-X[i-1])
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = map(int, input().split())
x = list(x)
for c in x:
    x_remove = x.copy()
    x_remove.remove(c)
    x_remove.insert(0,0)
    x_remove.append(0)
    i = 0
    ans = 0
    for i, b in enumerate(x_remove[1:]):
        ans += abs(x_remove[i] - b)        
    print(ans)

Fixed submission:
n = int(input())
X = map(int, input().split())
X = list(X)
# n = 3
# X = [3, 5, -1]

X.insert(0,0)
X.append(0)
Y = []
for i, x in enumerate(X[1:]):
    Y.append(abs(x-X[i]))
sumY = sum(Y)

for i, x in enumerate(X):
    if i not in [0,len(X)-1]:
        ans = sumY - (Y[i-1] + Y[i]) + abs(X[i+1]-X[i-1])
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = map(int, input().split())
x = list(x)
for c in x:
    x_remove = x.copy()
    x_remove.remove(c)
    x_remove.insert(0,0)
    x_remove.append(0)
    i = 0
    ans = 0
    for i, b in enumerate(x_remove[1:]):
        ans += abs(x_remove[i] - b)        
        i += 1
    print(ans)

Fixed submission:
n = int(input())
X = map(int, input().split())
X = list(X)
# n = 3
# X = [3, 5, -1]

X.insert(0,0)
X.append(0)
Y = []
for i, x in enumerate(X[1:]):
    Y.append(abs(x-X[i]))
sumY = sum(Y)

for i, x in enumerate(X):
    if i not in [0,len(X)-1]:
        ans = sumY - (Y[i-1] + Y[i]) + abs(X[i+1]-X[i-1])
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = map(int, input().split())
x = list(x)
for c in x:
    x_remove = x.copy()
    x_remove.remove(c)
    x_remove.insert(0,0)
    x_remove.append(0)
    i = 0
    ans = 0
    while i < len(x_remove)-1:
        ans += abs(x_remove[i+1] - x_remove[i])        
        i += 1
    print(ans)

Fixed submission:
n = int(input())
X = map(int, input().split())
X = list(X)
# n = 3
# X = [3, 5, -1]

X.insert(0,0)
X.append(0)
Y = []
for i, x in enumerate(X[1:]):
    Y.append(abs(x-X[i]))
sumY = sum(Y)

for i, x in enumerate(X):
    if i not in [0,len(X)-1]:
        ans = sumY - (Y[i-1] + Y[i]) + abs(X[i+1]-X[i-1])
        print(ans)
Buggy python submission (verdict: Runtime Error):
import collections

bluecard = []
redcard = []

n = int(input())
for i in range(n):
    bluecard.append(input())

m = int(input())
for i in range(m):
    redcard.append(input())

blue_count = collections.Counter(bluecard)
red_count = collections.Counter(redcard)
diff = blue_count - red_count
if len(diff.keys) > 0:
    print(diff.most_common(1)[0][1])
else:
    print(0)


Fixed submission:
import collections

bluecard = []
redcard = []

n = int(input())
for i in range(n):
    bluecard.append(input())

m = int(input())
for i in range(m):
    redcard.append(input())

blue_count = collections.Counter(bluecard)
red_count = collections.Counter(redcard)
diff = blue_count - red_count
if len(diff.keys()) > 0:
    print(diff.most_common(1)[0][1])
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
import collections

bluecard = []
redcard = []

n = int(input())
for i in range(n):
    bluecard.append(input())

m = int(input())
for i in range(m):
    redcard.append(input())

blue_count = collections.Counter(bluecard)
red_count = collections.Counter(redcard)
diff = blue_count - red_count
print(diff.most_common(1)[0][1])



Fixed submission:
import collections

bluecard = []
redcard = []

n = int(input())
for i in range(n):
    bluecard.append(input())

m = int(input())
for i in range(m):
    redcard.append(input())

blue_count = collections.Counter(bluecard)
red_count = collections.Counter(redcard)
diff = blue_count - red_count
if len(diff.keys()) > 0:
    print(diff.most_common(1)[0][1])
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
import collections

bluecard = []
redcard = []

n = int(input())
for i in range(n):
    bluecard.append(input())

m = int(input())
for i in range(m):
    redcard.append(input())

blue_count = collections.Counter(bluecard)
red_count = collections.Counter(redcard)
diff = red_count - blue_count
print(diff.most_common(1)[0][1])



Fixed submission:
import collections

bluecard = []
redcard = []

n = int(input())
for i in range(n):
    bluecard.append(input())

m = int(input())
for i in range(m):
    redcard.append(input())

blue_count = collections.Counter(bluecard)
red_count = collections.Counter(redcard)
diff = blue_count - red_count
if len(diff.keys()) > 0:
    print(diff.most_common(1)[0][1])
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
import collections

bluecard = []
redcard = []

n = int(input())
for i in range(n):
    bluecard.append(input())

m = int(input())
for i in range(m):
    bluecard.append(input())

blue_count = collections.Counter(bluecard)
red_count = collections.Counter(redcard)
diff = red_count - blue_count
print(diff.most_common(1)[0][1])



Fixed submission:
import collections

bluecard = []
redcard = []

n = int(input())
for i in range(n):
    bluecard.append(input())

m = int(input())
for i in range(m):
    redcard.append(input())

blue_count = collections.Counter(bluecard)
red_count = collections.Counter(redcard)
diff = blue_count - red_count
if len(diff.keys()) > 0:
    print(diff.most_common(1)[0][1])
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import sys
st = input()
if len(st) < 3:
    print('No')
    sys.exit()
if st[0] == 'Y':
    if st[1] == 'A':
        if st[2] == 'K':
            if st[3] == 'I':
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')




Fixed submission:
import sys
st = input()
if len(st) < 4:
    print('No')
    sys.exit()
if st[0] == 'Y':
    if st[1] == 'A':
        if st[2] == 'K':
            if st[3] == 'I':
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import sys
st = input()
if len(st) < 3:
    print('No')
    sys.exit()
if st[0] == 'Y':
    if st[1] == 'A':
        if st[2] == 'K':
            if st[3] == 'I':
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')




Fixed submission:
import sys
st = input()
if len(st) < 4:
    print('No')
    sys.exit()
if st[0] == 'Y':
    if st[1] == 'A':
        if st[2] == 'K':
            if st[3] == 'I':
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(raw_input())                                                                                                                                                                p = [1]                                                                                                                                                                             for j in [6, 9]:                                                                                                                                                                      i = j                                                                                                                                                                               while i < N:
    p.append(i)
    i *= j
c = [N] * (N+1)
c[1] = 1
for i in range(1, N+1):
  for j in p:
    if i+j <= N:
      c[i+j] = min(c[i+j], c[i]+1)
print c[N]

Fixed submission:
N = int(raw_input())
p = [1]
for j in [6, 9]:
  i = j
  while i <= N:
    p.append(i)
    i *= j
c = [N] * (N+1)
c[0] = 0
for i in range(0, N+1):
  for j in p:
    if i+j <= N:
      c[i+j] = min(c[i+j], c[i]+1)
print c[N]
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
if a+b=c:
    print(“Yes”)
if else b+c=a:
    print(“Yes”)
if else a+c=b:
    print(“Yes”)
else:
    print(“No”)


Fixed submission:
a,b,c=map(int,input().split())
if a+b==c:
    print("Yes")
elif b+c==a:
    print("Yes")
elif a+c==b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
D, N=map(int,input().split(' '))

assert N<100

print(N*100**D)



Fixed submission:
D, N=map(int,input().split(' '))

if N>=100:
  N+=1

print(N*100**D)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split(' '))

x=[]
y=[]
z=[]
for _ in range(N):
  _x,_y,_z=map(int,input().split(' '))
  x.append(_x)
  y.append(_y)
  z.append(_z)

def argmin(l):
  m=min(l)
  for i in range(len(l)):
    if l[i]==m:
      return i
  return i

def f(sign_x, sign_y, sign_z):
  l=[]
  for i in range(N):
    s=x[i]*sign_x + y[i]*sign_y + z[i]*sign_z
    if len(l)<M:
      l.append(s)
    elif min(l)<s:
      del l[argmin(l)]
      l.append(s)
  return sum(l)


res=0
for x_s in [1,-1]:
  for y_s in [1,-1]:
    for z_s in [1,-1]:
      score = f(x_s, y_s, z_s)
      if score>res:
        res=score

print(res)




Fixed submission:
N,M=map(int,input().split(' '))

x=[]
y=[]
z=[]
for _ in range(N):
  _x,_y,_z=map(int,input().split(' '))
  x.append(_x)
  y.append(_y)
  z.append(_z)

def argmin(l):
  m=min(l)
  for i in range(len(l)):
    if l[i]==m:
      return i

def f(sign_x, sign_y, sign_z):
  l=[]
  for i in range(N):
    s=x[i]*sign_x + y[i]*sign_y + z[i]*sign_z
    l.append(s)
    if len(l)>M:
      del l[argmin(l)]
  return sum(l)


res=0
for x_s in [1,-1]:
  for y_s in [1,-1]:
    for z_s in [1,-1]:
      score = f(x_s, y_s, z_s)
      if score>res:
        res=score

print(res)

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

x=[]
y=[]
z=[]
for _ in range(N):
  _x,_y,_z=map(int,input().split(' '))
  x.append(_x)
  y.append(_y)
  z.append(_z)

def argmin(l):
  m=min(l)
  for i in range(len(l)):
    if l[i]==m:
      return i

def f(sign_x, sign_y, sign_z):
  l=[]
  for i in range(N):
    s=x[i]*sign_x + y[i]*sign_y + z[i]*sign_z
    if len(l)<M:
      l.append(s)
    elif min(l)<s:
      del l[argmin(l)]
      l.append(s)
  return sum(l)



res=0
for x_s in [1,-1]:
  for y_s in [1,-1]:
    for z_s in [1,-1]:
      score = f(x_s, y_s, z_s)
      if score>res:
        res=score

print(res)




Fixed submission:
N,M=map(int,input().split(' '))

x=[]
y=[]
z=[]
for _ in range(N):
  _x,_y,_z=map(int,input().split(' '))
  x.append(_x)
  y.append(_y)
  z.append(_z)

def argmin(l):
  m=min(l)
  for i in range(len(l)):
    if l[i]==m:
      return i

def f(sign_x, sign_y, sign_z):
  l=[]
  for i in range(N):
    s=x[i]*sign_x + y[i]*sign_y + z[i]*sign_z
    l.append(s)
    if len(l)>M:
      del l[argmin(l)]
  return sum(l)


res=0
for x_s in [1,-1]:
  for y_s in [1,-1]:
    for z_s in [1,-1]:
      score = f(x_s, y_s, z_s)
      if score>res:
        res=score

print(res)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,raw_input().split(' '))

print(max(A+B, A-B, A*B))



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

print(max(A+B, A-B, A*B))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(raw_input())
a=map(int,raw_input().split(' '))

ans=[]


def check(l):
  for i in range(len(l)-1):
    if l[i]>l[i+1]:
      return 0
  return 1

u=N-1
while not check(a):
  p=np.argmax(a[0:u+1])
  m=max(a[0:u+1])
  if p==u:
    u-=1
  else:
    if m>0:
      for i in range(p+1,u+1):
        ans+=[(p+1, i+1)]
        a[i]+=a[p]
    else:
      p=np.argmin(a)
      m=min(a)
      for i in range(p):
        ans+=[(p+1, i+1)]
        a[i]+=a[p]

print len(ans)
for an in ans:
  x,y=an
  print x,y

Fixed submission:
N=int(raw_input())
a=map(int,raw_input().split(' '))

flg=0
if abs(max(a))>=abs(min(a)):
  m=max(a)
  flg=1
else:
  m=min(a)

for i in range(len(a)):
  if a[i]==m:
    p=i
    break

print 2*N-1
for i in range(N):
  print p+1, i+1
  a[i]+=a[p]

if flg:
  for i in range(N-1):
    print i+1, i+2
    a[i+1]+=a[i]
else:
  for i in range(N-1)[::-1]:
    print i+2, i+1
    a[i]+=a[i+1]
#print a

Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(raw_input())
a=map(int,raw_input().split(' '))

ans=[]

if len(set(a))==1:
  p=0
else:
  p=N-1

def check(l):
  for i in range(len(l)-1):
    if l[i]>l[i+1]:
      return 0
  return 1

l=0
u=N-1
while not check(a):
  p=np.argmax(a[0:u+1])
  m=max(a[0:u+1])
  if p==u:
    u-=1
  else:
    if m>0:
      for i in range(p+1,u+1):
        ans+=[(p+1, i+1)]
        a[i]+=a[p]
    else:
      p=np.argmin(a[0:u+1])
      m=min(a[0:u+1])
      for i in range(p):
        ans+=[(p+1, i+1)]
        a[i]+=a[p]

print len(ans)
for an in ans:
  x,y=an
  print x,y

Fixed submission:
N=int(raw_input())
a=map(int,raw_input().split(' '))

flg=0
if abs(max(a))>=abs(min(a)):
  m=max(a)
  flg=1
else:
  m=min(a)

for i in range(len(a)):
  if a[i]==m:
    p=i
    break

print 2*N-1
for i in range(N):
  print p+1, i+1
  a[i]+=a[p]

if flg:
  for i in range(N-1):
    print i+1, i+2
    a[i+1]+=a[i]
else:
  for i in range(N-1)[::-1]:
    print i+2, i+1
    a[i]+=a[i+1]
#print a
Buggy python submission (verdict: Runtime Error):
N,M=map(int,raw_input().split(' '))

g=[[False for i in range(N)] for j in range(N)]
ab=[()]*N
v=[False]*N

def dfs(n):
    v[n]=True
    for i in range(N):
        if g[n][i]==True and v[i]==False:
            dfs(i)

for i in range(M):
    a,b=map(int,raw_input().split(' '))
    a-=1
    b-=1
    g[a][b]=g[b][a]=True
    ab[i]=(a,b)

ans=0
for i in range(M):
    a,b=ab[i]
    g[a][b]=g[b][a]=False

    dfs(0)

    if v!=[True]*N:
        ans+=1

    g[a][b]=g[b][a]=True
    v=[False]*N

print ans



Fixed submission:
a,b,c=map(int,raw_input().split(' '))

if a==b:
    print c
elif b==c:
    print a
else:
    print b
Buggy python submission (verdict: Runtime Error):
N,M=map(int,raw_input().split(' '))

g=[[False for i in range(N)] for j in range(N)]
ab=[()]*N
v=[False]*N

def dfs(n):
    v[n]=True
    for i in range(N):
        if g[n][i]==True and v[i]==False:
            dfs(i)

for i in range(M):
    a,b=map(int,raw_input().split(' '))
    a-=1
    b-=1
    g[a][b]=g[b][a]=True
    ab[i]=(a,b)

ans=0
for i in range(M):
    a,b=ab[i]
    g[a][b]=g[b][a]=False

    dfs(0)

    if v!=[True]*N:
        ans+=1

    g[a][b]=g[b][a]=True
    v=[False]*N

print ans



Fixed submission:
N,M=map(int,raw_input().split(' '))

g=[[False for i in range(N)] for j in range(N)]
ab=[()]*M
v=[False]*N

def dfs(n):
    v[n]=True
    for i in range(N):
        if g[n][i]==True and v[i]==False:
            dfs(i)

for i in range(M):
    a,b=map(int,raw_input().split(' '))
    a-=1
    b-=1
    g[a][b]=g[b][a]=True
    ab[i]=(a,b)

ans=0
for i in range(M):
    a,b=ab[i]
    g[a][b]=g[b][a]=False

    dfs(0)

    if v!=[True]*N:
        ans+=1

    g[a][b]=g[b][a]=True
    v=[False]*N

print ans

Buggy python submission (verdict: Runtime Error):
N,M=map(int,raw_input().split(' '))

g=[[False for i in range(N)] for j in range(N)]
ab=[()]*N
v=[False]*N

def dfs(n):
    v[n]=True
    for i in range(N):
        if g[n][i]==True and v[i]==False:
            dfs(i)

for i in range(M):
    a,b=map(int,raw_input().split(' '))
    a-=1
    b-=1
    g[a][b]=g[b][a]=1
    ab[i]=(a,b)

ans=0
for i in range(M):
    a,b=ab[i]
    g[a][b]=g[b][a]=False

    dfs(0)

    if v!=[True]*N:
        ans+=1

    g[a][b]=g[b][a]=True
    v=[False]*N

print ans



Fixed submission:
N,M=map(int,raw_input().split(' '))

g=[[False for i in range(N)] for j in range(N)]
ab=[()]*M
v=[False]*N

def dfs(n):
    v[n]=True
    for i in range(N):
        if g[n][i]==True and v[i]==False:
            dfs(i)

for i in range(M):
    a,b=map(int,raw_input().split(' '))
    a-=1
    b-=1
    g[a][b]=g[b][a]=True
    ab[i]=(a,b)

ans=0
for i in range(M):
    a,b=ab[i]
    g[a][b]=g[b][a]=False

    dfs(0)

    if v!=[True]*N:
        ans+=1

    g[a][b]=g[b][a]=True
    v=[False]*N

print ans
Buggy python submission (verdict: Time Limit Exceeded):
N=int(raw_input())

num=[]
for i in range(N):
    num.append(int(raw_input()))

sn=set(num)

c=0
for n in sn:
    if num.count(n)%2==1:
        c+=1

print c

Fixed submission:
N=int(raw_input())

num={}
for i in range(N):
    a=int(raw_input())
    if a in num:
        num[a]^=1
    else:
        num[a]=1

c=0
for k in num:
    if num[k]==1:
        c+=1
print c

Buggy python submission (verdict: Runtime Error):
N=int(raw_input())

n=[0]*(10**9+1)

for i in range(N):
    a=int(raw_input())
    n[a]^=1

print n.count(1)


Fixed submission:
N=int(raw_input())

num={}
for i in range(N):
    a=int(raw_input())
    if a in num:
        num[a]^=1
    else:
        num[a]=1

c=0
for k in num:
    if num[k]==1:
        c+=1
print c