qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n,m=map(int,input().split())
l=[0 for i in range(n)]
l[0]=1
lc=[1 for i in range(n)]
for i in range(m):
  a,b=map(int,input().split())
  if l[a-1]==1 and lc[a-1]==1:
    lc[a-1]=0
    l[a-1]=0
    l[b-1]=1
    lc[b-1]+=1
  elif l[a-1]==1:
    lc[a-1]-=1
    l[b-1]=1
    lc[b-1]+=1
  else:
    lc[a-1]-=1
    lc[b-1]+=1
ans=0
for i in range(n):
  if l[i]==1 and lc[i]>0:
    ans+-1
print(ans)
      

Fixed code:
n,m=map(int,input().split())
l=[0 for i in range(n)]
l[0]=1
lc=[1 for i in range(n)]
for i in range(m):
  a,b=map(int,input().split())
  if l[a-1]==1 and lc[a-1]==1:
    lc[a-1]=0
    l[a-1]=0
    l[b-1]=1
    lc[b-1]+=1
  elif l[a-1]==1:
    lc[a-1]-=1
    l[b-1]=1
    lc[b-1]+=1
  else:
    lc[a-1]-=1
    lc[b-1]+=1
ans=0
for i in range(n):
  if l[i]==1 and lc[i]>0:
    ans+=1
print(ans)
Buggy code:
n,m=map(int,input().split())
aru=1
a=[1]*n
ans=set()
for i in range(m):
  x,y=map(int,input().split())
  if a[x-1]==0:continue
  else:
    a[x-1]-=1
    a[y-1]+=1
    if aru==x:
      aru=y
      if a[x-1]!=0:
        ans.add(x)
print(len(ans))

Fixed code:
n,m=map(int,input().split())
a=[1]*n
ans=set([1])
for i in range(m):
  x,y=map(int,input().split())
  if a[x-1]==0:continue
  else:
    a[x-1]-=1
    a[y-1]+=1
    if x in ans:
      ans.add(y)
      if a[x-1]==0:ans.remove(x)
print(len(ans))
Buggy code:
n,m=map(int,input().split())
b=[1]*n
red=[False]*n
red[0]=True
for i in range(m):
  x,y=map(int,input().split())
  if not b[x]:
    continue
  x,y=x-1,y-1
  b[y]+=1
  red[y]=red[x]
  
  b[x]-=1
  if b[x]==0:
    red[x]=False
    
print(red.count(True))


Fixed code:
n,m=map(int,input().split())
b=[1]*n
red=[False]*n
red[0]=True
for i in range(m):
  x,y=map(int,input().split())
  x,y=x-1,y-1
  if not b[x]:
    continue
  b[y]+=1
  if red[x]:
    red[y]=True
  
  b[x]-=1
  if b[x]==0:
    red[x]=False
    
print(red.count(True))
Buggy code:
n,m=map(int,input().split())
r=[False]*n
l=[1]*n
r[0]=True
for i in range(m):
  x,y=map(int,input().split())
  x-=1;y-=1
  if r[x]:
    r[y]=True
  l[x]-=1
  l[y]+=1
s=0
for i in range(n):
  if r[i]:
    if l[i]:
      s+=1
print(s)

Fixed code:
n,m=map(int,input().split())
r=[False]*n
l=[1]*n
r[0]=True
for i in range(m):
  x,y=map(int,input().split())
  x-=1;y-=1
  if r[x]:
    r[y]=True
  l[x]-=1
  l[y]+=1
  if l[x]==0:
    r[x]=False
s=0
for i in range(n):
  if r[i]:
    if l[i]:
      s+=1
print(s)
Buggy code:
def main():
    N, M = map(int, input().split())
    cnt = [0] * N
    red = [0] * N
    red[0] = 1
    for _ in range(M):
        x, y = map(int, input().split())
        x -= 1
        y -= 1
        if red[x] == 1:
            red[x] -= 1
            red[y] += 1
            cnt[y] += 1

    ans = 0
    for i in cnt:
        if i > 0:
            ans += 1

    print(ans)

if __name__ == "__main__":
    main()

Fixed code:
def main():
    N, M = map(int, input().split())
    cnt = [1] * N
    red = [False] * N
    red[0] = True
    for _ in range(M):
        x, y = map(int, input().split())
        x -= 1
        y -= 1
        cnt[x] -= 1
        cnt[y] += 1
        if red[x] == True:
            red[y] = True
            if cnt[x] == 0:
                red[x] = False
    ans = 0
    for i in red:
        if i:
            ans += 1

    print(ans)

if __name__ == "__main__":
    main()
Buggy code:
n,m=map(int,input().split())
print(n,m)

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	print(li)
	if x in se:
		se.add(y)
	if li[x]==0:
		se.remove(x)
print(len(se))

Fixed code:
n,m=map(int,input().split())

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	if x in se:
		se.add(y)
		if li[x]==0:
			se.remove(x)
print(len(se))
Buggy code:
n,m=map(int,input().split())
balls=[1 for i in range(n)]
pro=[False for i in range(n)]
pro[0]=True

for inp in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    balls[a]-=1
    balls[b]+=1
    if pro[a]:
        pro[b]=True
    
for i in range(n):
    if balls[i]==0:
        pro[i]=False

#print(pro)
print(pro.count(True))

Fixed code:
n,m=map(int,input().split())
balls=[1 for i in range(n)]
pro=[False for i in range(n)]
pro[0]=True

for inp in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    balls[a]-=1
    balls[b]+=1
    if pro[a]:
        pro[b]=True
    if balls[a]==0:
        pro[a]=False


#print(pro)
print(pro.count(True))
Buggy code:
n,m = map(int,input().split())
num = [1 for c in range(n)]
red = [False for d in range(n)]
red[0] = True
counter = 0
for i in range(m):
    x,y = map(int,input().split())
    red[y-1] = True
    num[x-1] = num[x-1] - 1
    num[y-1] = num[y-1] + 1
for j in range(n):
    if (red[j] == True)&(num[j]>0):
        counter += 1
print(counter)

Fixed code:
n,m = map(int,input().split())
num = [1 for c in range(n)]
red = [False for d in range(n)]
red[0] = True
counter = 0
for i in range(m):
    x,y = map(int,input().split())
    if red[x-1]:
        red[y-1] = True
    num[x-1] = num[x-1] - 1
    num[y-1] = num[y-1] + 1
    if num[x-1] == 0:
        red[x-1] = False
for j in range(n):
    if (red[j] == True)&(num[j]>0):
        counter += 1
print(counter)
Buggy code:
N,M = list(map(int, input().split()))
XY = [list(map(int, input().split())) for _ in range(M)]

red = set([1])
n_ball = [1]*(N+1)

for x,y in XY:
  n_ball[x] -= 1
  n_ball[y] += 1
  if x in red:
    red.add(y)
    if n_ball[x]==0:
      red.remove(x)
  print(red)
  print(n_ball)
print(len(red))

Fixed code:
N,M = list(map(int, input().split()))
XY = [list(map(int, input().split())) for _ in range(M)]

red = set([1])
n_ball = [1]*(N+1)

for x,y in XY:
  n_ball[x] -= 1
  n_ball[y] += 1
  if x in red:
    red.add(y)
    if n_ball[x]==0:
      red.remove(x)
print(len(red))
Buggy code:
n, m = map(int, input().split())
stack = [1]*n
p = [False]*n
p[0] = True

for i in range(m):
    x, y = map(int, input().split())
    stack[x-1] -= 1
    stack[y-1] += 1
    p[y-1] = p[x-1] or p[y-1]
    if stack[0] == 0:
        p[0] = False

for i in p:
    if i:
        ans += 1
print(ans)

Fixed code:
n, m = map(int, input().split())
stack = [1]*n
p = [False]*n
p[0] = True

for i in range(m):
    x, y = map(int, input().split())
    stack[x-1] -= 1
    stack[y-1] += 1
    p[y-1] = p[x-1] or p[y-1]
    if stack[x-1] == 0:
        p[x-1] = False

ans = 0
for i in p:
    if i:
        ans += 1
print(ans)
Buggy code:
n, m = map(int, input().split())
box = [0] * (n+1)
box[1] = 1
for i in range(m):
  x, y = map(int, input().split())
  if box[x]:
    box[y] = 1
print(sum(box))

Fixed code:
n,m=map(int,input().split())
box=[1]*n
boxz=[1]+[0]*(n-1)
for i in range(m):
    x,y=map(int,input().split())
    box[y-1]+=1
    box[x-1]-=1
    if boxz[x-1]==1:
        boxz[y-1]=1
        if box[x-1]==0:
            boxz[x-1]=0
print(sum(boxz))
Buggy code:
a,b = map(int, input().split())
n = [1]*a
r = [0]*a
r[1] = 1

for i in range(b):
    ta,tb = map(int, input().split())
    ta-=1
    tb-=1
    if r[ta] == 1:
        r[tb] = 1
    n[ta] -=1
    n[tb] -=1
    if n[ta] ==0:
        r[ta] = 0
print(sum(r)) 


Fixed code:
a,b = map(int, input().split())
n = [1]*a
r = [0]*a
r[0] = 1

for i in range(b):
    ta,tb = map(int, input().split())
    ta-=1
    tb-=1
    if r[ta] == 1:
        r[tb] = 1
    n[ta] -=1
    n[tb] +=1
    if n[ta] ==0:
        r[ta] = 0
print(sum(r))
Buggy code:
N,M=list(map(int,input().split()))
W=[list(map(lambda x:int(x)-1,input().split())) for _ in range(M)]
BOX=[[1,1]]
BOX.extend([[1,0] for _ in range(N)])
for i in range(M):
    BOX[W[i][0]][0]=BOX[W[i][0]][0]-1
    BOX[W[i][1]][0]=BOX[W[i][1]][0]+1
    if(BOX[W[i][0]][1]==1):
        BOX[W[i][1]][1]=1
        if(BOX[W[i][0]][0]==1):
            BOX[W[i][0]][1]=0
print(sum(list(map(lambda x:x[:][1],BOX))))
    


Fixed code:
N,M=list(map(int,input().split()))
W=[list(map(lambda x:int(x)-1,input().split())) for _ in range(M)]
BOX=[[1,1]]
BOX.extend([[1,0] for _ in range(N)])
for i in range(M):
    BOX[W[i][0]][0]=BOX[W[i][0]][0]-1
    BOX[W[i][1]][0]=BOX[W[i][1]][0]+1
    if(BOX[W[i][0]][1]==1):
        BOX[W[i][1]][1]=1
        if(BOX[W[i][0]][0]==0):
            BOX[W[i][0]][1]=0
print(sum(list(map(lambda x:x[:][1],BOX))))
Buggy code:
N, M = [int(_) for _ in input().split()]
XY = [[int(_) - 1 for _ in input().split()] for _ in range(M)]

red = [False] * M
red[0] = True
num = [1] * M

for x, y in XY:
    num[x] -= 1
    num[y] += 1
    if red[x] == True:
        red[y] = True
        if num[x] == 0:
            red[x] = False
print(sum(red))

# http://agc002.contest.atcoder.jp/data/agc/002/editorial.pdf


Fixed code:
N, M = [int(_) for _ in input().split()]
XY = [[int(_) - 1 for _ in input().split()] for _ in range(M)]

red = [False] * N
red[0] = True
num = [1] * N

for x, y in XY:
    num[x] -= 1
    num[y] += 1
    if red[x] == True:
        red[y] = True
        if num[x] == 0:
            red[x] = False
print(sum(red))

# http://agc002.contest.atcoder.jp/data/agc/002/editorial.pdf
Buggy code:
n, m = map(int,input().split())
f = [False for _ in range(n)]
c = [1 for _ in range(n)]
f[0] = True
for i in range(m):
  x, y = map(int,input().split())
  f[y - 1] = f[y - 1] or f[x - 1]
  c[y - 1] += 1
  c[x - 1] -= 1
ans = 0
for i in range(n):
  if f[i] and c[i] > 0:
    ans += 1
print(ans)


Fixed code:
n, m = map(int,input().split())
f = [False for _ in range(n)]
c = [1 for _ in range(n)]
f[0] = True
for i in range(m):
  x, y = map(int,input().split())
  f[y - 1] = f[y - 1] or f[x - 1]
  c[y - 1] += 1
  c[x - 1] -= 1
  if c[x - 1] == 0:
    f[x - 1] = False
ans = 0
for i in range(n):
  if f[i] and c[i] > 0:
    ans += 1
print(ans)
Buggy code:
n,m=map(int,input().split())
x=[0]*n
x[0]=1
for i in range(m):
  a,b=map(int,input().split())
  if x[a-1]==1:x[b-1]=1
print(sum(x))

Fixed code:
n,m=map(int, input().split())
a=[1]*n
b=[1]+[0]*(n-1)
for i in range(m):
    x,y=map(int, input().split())
    a[x-1]-=1
    a[y-1]+=1
    if b[x-1]==1:b[y-1]=1
    if a[x-1]==0:b[x-1]=0
print(sum(b))
Buggy code:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


N, M = inpl()
move = [inpl() for _ in range(M)]

ans = [0 for _ in range(N)]
ans[0] = 1
box = [1 for _ in range(N)]
# print(ans, box)
for i in range(M):
    x, y = move[i]
    box[x - 1] -= 1
    box[y - 1] += 1
    if ans[x - 1]:
        ans[y - 1] = 1
        if box[x - 1] == 0:
            ans[x - 1] = 0
    # print(ans, box)


print(sum(ans), ans)

Fixed code:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


N, M = inpl()
move = [inpl() for _ in range(M)]

ans = [0 for _ in range(N)]
ans[0] = 1
box = [1 for _ in range(N)]
# print(ans, box)
for i in range(M):
    x, y = move[i]
    box[x - 1] -= 1
    box[y - 1] += 1
    if ans[x - 1]:
        ans[y - 1] = 1
        if box[x - 1] == 0:
            ans[x - 1] = 0
    # print(ans, box)


print(sum(ans))
Buggy code:
f = lambda: list(map(int,input().split()))
f_ = lambda: [int(x)-1 for x in input().split()]

n,m = f()
sus = set()
conf = [0]
num = [1 for _ in range(n)]
for _ in range(m):
    x,y = f_()
    if x in conf:
        if num[y]==0:
            conf = [y]
        else:
            conf = []
            sus.add(y)
    elif y in conf:
        conf = []
        sus.add(y)
    elif x in sus:
        sus.add(y)
    num[x] -= 1; num[y] += 1
print(max(len(sus),1))

Fixed code:
f = lambda: list(map(int,input().split()))
f_ = lambda: [int(x)-1 for x in input().split()]

n,m = f()
sus = set()
conf = [0]
num = [1 for _ in range(n)]
for _ in range(m):
    x,y = f_()
    num[x] -= 1; num[y] += 1
    if x in conf:
        if num[y] == 1:
            conf = [y]
        else:
            conf = []
            sus.add(y)
    elif y in conf:
        conf = []
        sus.add(y)
    elif x in sus:
        sus.add(y)
        if num[x] == 0:
            sus.remove(x)
print(max(len(sus),1))
Buggy code:
    n, l = (int(s) for s in input().strip().split(' '))
    an = []
for a in range(0,l):
    an.append(input().strip().split())

box=[[1,0] for i in range(n)]
box[0][1] = 1
for move in an:
    box[int(move[0])-1][0] -= 1
    box[int(move[1])-1][0]+=1
    if box[int(move[0])-1][1] == 1:
        box[int(move[1])-1][1]= 1
    if box[int(move[0])-1][0]==0:
        box[int(move[0])-1][1]=0
print(str(sum([s[1] for s in box])))

Fixed code:
n, l = (int(s) for s in input().strip().split(' '))
an = []
for a in range(0,l):
    an.append(input().strip().split())
box=[[1,0] for i in range(n)]
box[0][1] = 1
for move in an:
    box[int(move[0])-1][0] -= 1
    box[int(move[1])-1][0]+=1
    if box[int(move[0])-1][1] == 1:
        box[int(move[1])-1][1]= 1
    if box[int(move[0])-1][0]==0:
        box[int(move[0])-1][1]=0
print(str(sum([s[1] for s in box])))
Buggy code:
n, m = map(int,input().split())
f = [True] * n
num = [1] * n

for i in range(m):
    x, y = map(int,input().split())
    x -= 1
    y -= 1

    num[x] -= 1
    num[y] += 1

    if num[x] == 0:
        f[x] = False

    f[y] = True

cnt = 0
for i in range(n):
    if f[i]:
        cnt += 1

print(cnt)

Fixed code:
n, m = map(int,input().split())
f = [False] * n
f[0] = True
num = [1] * n

for i in range(m):
    x, y = map(int,input().split())
    x -= 1
    y -= 1

    num[x] -= 1
    num[y] += 1

    if f[x]:
        f[y] = f[x]

    if num[x] == 0:
        f[x] = False

cnt = 0
for i in range(n):
    if f[i]:
        cnt += 1

print(cnt)
Buggy code:
n=list(map(input().split()))
print("YES" if n==["5","7","5"] or n==["7","5","5"] or n==["5","5","7"] else "NO")

Fixed code:
n=list(input().split())
print("YES" if (n==["5","7","5"] or n==["7","5","5"] or n==["5","5","7"] ) else "NO")
Buggy code:
A=list(map(int,input().split()))
sort(A)
if A==[5,5,7]:
  print("YES")
else:
  print("NO")
    


Fixed code:
a=list(map(int,input().split()))
a.sort()
if a == [5,5,7]:
  print("YES")
else:
  print("NO")
Buggy code:
print("YNeos"[sorted(map(int,input().split()))!=[5,5,7]::2])

Fixed code:
print("YNEOS"[sorted(map(int,input().split()))!=[5,5,7]::2])
Buggy code:
a,b,c=map(int,input().split())
if (a+b==10 and a==5 and c==7) or (a+b=12 and c==5 and (a==5 or b==5)):
  print("YES")
else:
  print("NO")

Fixed code:
a,b,c=map(int,input().split())
if ((a+b==10 and a==5) and c==7) or ((a+b==12 and c==5) and (a==5 or b==5)):
  print("YES")
else:
  print("NO")
Buggy code:
syl=sorted(list(map(int,input().split())))

print(syl)

syl2=[5, 5, 7]

if syl == syl2:
	print('YES')
else:
	print('NO')

Fixed code:
syl=sorted(list(map(int,input().split())))

syl2=[5, 5, 7]

if syl == syl2:
	print('YES')
else:
	print('NO')
Buggy code:
X = sorted([map(int,input().split(' '))])
print('YES' if X == [5,5,7] else 'NO')

Fixed code:
s = sorted(map(int, input().split()))
print('YES' if s == [5, 5, 7] else 'NO')
Buggy code:
X = [map(int,input().split(' '))]
print('YES' if X == [5,5,7] else 'NO')

Fixed code:
X = sorted(list(map(int,input().split(' '))))
print('YES' if X == [5,5,7] else 'NO')
Buggy code:
a, b, c = map(int, input().split())
five = 0;
if a == 5:
  five = five + 1;
elif a == 7:
  seven = seven + 1;
if b == 5:
  five = five + 1;
elif b == 7:
  seven = seven + 1;
if c == 5:
  five = five + 1;
elif c == 7:
  seven = seven + 1;
if five == 2 and seven == 1:
  print("YES")
else:
  print("NO")

Fixed code:
a, b, c = map(int, input().split())
five = 0
seven =0
if a == 5:
  five = five + 1;
elif a == 7:
  seven = seven + 1;
if b == 5:
  five = five + 1;
elif b == 7:
  seven = seven + 1;
if c == 5:
  five = five + 1;
elif c == 7:
  seven = seven + 1;
if five == 2 and seven == 1:
  print("YES")
else:
  print("NO")
Buggy code:
lista=list(map(int,input().split()))
lista.sort()
if lista==[5,5,7]:
    print("YES")
else:
    ptinr("NO")

Fixed code:
lista=list(map(int,input().split()))
lista.sort()
if lista==[5,5,7]:
    print("YES")
else:
    print("NO")
Buggy code:
    s = input().split()
     
    if s.count('5') == 2 and s.count('7') == 1:
      print('YES')
    else:
      print('NO')

Fixed code:
inp = input().split()
if inp.count('7') == 1 and inp.count('5') == 2:
  print("YES")
else:
  print("NO")
Buggy code:
a = list(map(int,input().split()))

a,sort()
print('YES' if a[0] == 5 and a[1] == 5 and a[2] == 7 else 'NO')


Fixed code:
a = list(map(int,input().split()))
 
a.sort()
print('YES' if a[0] == 5 and a[1] == 5 and a[2] == 7 else 'NO')
Buggy code:
A, B, C = map(int, input().split())
fsf = [A, B, C]
if fsf.count(5) == 2 & fsf.count(7) == 1:
  print("YES")
else:
  print("NO")

Fixed code:
A, B, C = map(int, input().split())
fsf = [A, B, C]
if (fsf.count(5) == 2) & (fsf.count(7) == 1):
    print("YES")
else:
    print("NO")
Buggy code:
A = list(map(int, input().sprit()))
ans = sorted(A)
if ans == [5,5,7]:
  print('YES')
else:
  print('NO')

Fixed code:
A=list(map(int,input().split()))
ans=sorted(A)
if ans==[5,5,7]:
  print('YES')
else:
  print('NO')
Buggy code:
def main():
  print("aaa")
  a = list(input().split())
  a = [int(aa) for aa in a]
  a = sorted(a)
  if a==[5,7,7]:
    return "YES"
  else:
    return "NO"
  
  
if __name__ == "__main__":
  main()

Fixed code:
def main():
  a = list(input().split())
  a = [int(aa) for aa in a]
  a = sorted(a)
  if a==[5,5,7]:
    print('YES')
  else:
    print('NO')
  
  
if __name__ == "__main__":
  main()
Buggy code:
a, b, c = sorted(map(int, input().split()))
if a, b, c = 5, 5, 7:
  print("YES")
else:
  print("NO")

Fixed code:
a,b,c=map(int, input().split())
if a*b*c==5*5*7:
    print("YES")
else:
    print("NO")
Buggy code:
A,B,C = map(int,inputs().split())

if A + B + C == 17:
  if A + B or A + C or B + C == 10:
    print("YES")
  else:
    print("NO")
else:
  print("NO")

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

if A + B + C == 17:
  if A + B or A + C or B + C == 10:
    print("YES")
  else:
    print("NO")
else:
  print("NO")
Buggy code:
A = map(int, input().split())
if A.sort() == [5,5,7]:
  print("YES")
else:
  print("NO")

Fixed code:
A = list(map(int, input().split()))
A.sort()
if A == [5,5,7]:
  print("YES")
else:
  print("NO")
Buggy code:
A = list(map(int, input().split()))
if A.sort() == [5,5,7]:
  print("YES")
else:
  print("NO")

Fixed code:
A = list(map(int,input().split()))
A = sorted(A)
if A == [5,5,7]:
    print("YES")
else:
    print("NO")
Buggy code:
a = sorted([int (s) for s in input().strip().split(' ')])
print("YES" if a == [5,5,7] else "No")

Fixed code:
a = sorted([int (s) for s in input().strip().split(' ')])
print("YES" if a == [5,5,7] else "NO")
Buggy code:
a = list(map(int,input().split()))
if sum(a) == 17 and a.count("5") == 2:
  print("YES")
else:
  print("NO")

Fixed code:
a = list(map(int,input().split()))
if sum(a) == 17 and a.count(5) == 2:
  print("YES")
else:
  print("NO")
Buggy code:
A, B, C = map(int, input().split())

l = [A, B, C]

l = sorted(l, reverse=True)

if l[0] == l[1] == 5 and l[2] == 7:
    print('YES')
else:
    print('NO')


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

l = [A, B, C]

l = sorted(l)

if l[0] == l[1] == 5 and l[2] == 7:
    print('YES')
else:
    print('NO')
Buggy code:
A = sorted(input().split())
print('YES' if A[0]==5 and A[1]==5 and A[2]==7 else 'NO')


Fixed code:
A = sorted(input().split())
print('YES' if A[0]=='5' and A[1]=='5' and A[2]=='7' else 'NO')
Buggy code:
s = "5 5 7"
k = list(map(int, s.split()))
k.sort()
print("YES"if k == [5,5,7] else "NO")

Fixed code:
k = list(map(int, input().split()))
k.sort()
print("YES"if k == [5,5,7] else "NO")
Buggy code:
s = input().rstrip().split(' ')
counta = 0
countb = 0
for i in range(len(s)):
	if int(s[i]) == 7:
    	counta += 1
    elif int(s[i]) == 5:
		countb += 1
if counta == 1 and countb == 2:
	print('YES')
else:
	print('NO')

Fixed code:
s = input().rstrip().split(' ')
counta = 0
countb = 0
for i in range(int(len(s))):
	if int(s[i]) == 7:
		counta += 1
	elif int(s[i]) == 5:
		countb += 1
if counta == 1 and countb == 2:
	print('YES')
else:
	print('NO')
Buggy code:
value = input()
if value.count(5) ==2:
  if value.count(7) ==1:
    print('YES')
  else:
    print('NO')
else:
  print('NO')
  


Fixed code:
value = input()
if value.count("5") ==2:
  if value.count("7") ==1:
    print('YES')
  else:
    print('NO')
else:
  print('NO')
Buggy code:
def is_575(bunsetsu_list):
    return bunsetsu_list.count(5) == 2 and bunsetsu_list.count(7) == 1


def main():
  bunsetsu_list = [int(i) for i in input().split()]
  print('YES' if is_575 else 'NO')
  
  
main()

Fixed code:
def is_575(bunsetsu_list):
    return bunsetsu_list.count(5) == 2 and bunsetsu_list.count(7) == 1
 
 
def main():
  bunsetsu_list = [int(i) for i in input().split()]
  print('YES' if is_575(bunsetsu_list) else 'NO')
  
  
main()
Buggy code:
l = list(map(int, input().split()))
l.sort()
ans = NO
if l == [5, 5, 7]:
  ans = YES
print(ans)

Fixed code:
l = list(map(int, input().split()))
l.sort()
ans = 'NO'
if l == [5, 5, 7]:
  ans = 'YES'
print(ans)
Buggy code:
abc_list = list(map(int, input().split()))

if abc_list.count("5") ==2 and abc_list.count("7") == 1:
    print("YES")
else:
    print("NO")
    

Fixed code:
ls = list(map(int, input().split()))

if ls.count(5) == 2 and ls.count(7) == 1:
    print("YES")
else:
    print("NO")
Buggy code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

a = list(map(int, input().split()))

if 7 == a[0]:
    if 5 == a[1] and 5 == a[2]:
        print("YES", end="\n")
elif 5 == a[0]:
    if (7 == a[1] and 5 == a[2]) or (5 == a[1] and 7 == a[2]):
        print("YES", end="\n")
else:
    print("NO", end="\n")

Fixed code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

a = list(map(int, input().split()))

if 7 == a[0]:
    if 5 == a[1] and 5 == a[2]:
        print("YES", end="\n")
    else:
        print("NO", end="\n")   

elif 5 == a[0]:
    if (7 == a[1] and 5 == a[2]) or (5 == a[1] and 7 == a[2]):
        print("YES", end="\n")
    else:
        print("NO", end="\n")   
else:
    print("NO", end="\n")
Buggy code:
a=list(map(int,input().split()))
if a.index(7)==1 and a.index(5)==2:
    print("YES")
else:
    print("NO")

Fixed code:
a=list(map(int,input().split()))
if a.count(7)==1 and a.count(5)==2:
    print("YES")
else:
    print("NO")
Buggy code:
a = list(map(int,input().split()))
b = 0
c = 0
for i in a:
  if i == 7:
    b += 1
  elif i == 5:
    c += 1

if b == 2 and c == 1:
  print("YES")
else:
  print("NO")

Fixed code:
a = list(map(int,input().split()))
b = 0
c = 0
for i in a:
  if i == 7:
    b += 1
  elif i == 5:
    c += 1

if b == 1 and c == 2:
  print("YES")
else:
  print("NO")
Buggy code:
a = list(map(int, input().split()))
d = 0
e = 0
for i in range(3):
  f = a[i]
  if f == 7:
    d += 1
  elif f == 5:
    e += 1
  else:
    break
if d == 2 and e == 1:
  print("YES")
else:
  print("NO")


Fixed code:
a = list(map(int, input().split()))
d = 0
e = 0
for i in range(3):
  f = a[i]
  if f == 7:
    d += 1
  elif f == 5:
    e += 1
  else:
    break
if d == 1 and e == 2:
  print("YES")
else:
  print("NO")
Buggy code:
l = sort(list(map(int,input().split())))
if l==[5,5,7]:
    print('YES')
else:
    print('NO')

Fixed code:
l = sorted(list(map(int,input().split())))
if l==[5,5,7]:
    print('YES')
else:
    print('NO')
Buggy code:
s=list(map(int,input().split()))
s.sort()
if s[0]==7 and s[1]==5 and s[2]==5:
  print("YES")
else:
  print("NO")

Fixed code:
s=list(map(int,input().split()))
s.sort()
if s[0]==5 and s[1]==5 and s[2]==7:
  print("YES")
else:
  print("NO")
Buggy code:
print("YES" if sorted(input().split())==["5","5","7"] else "NO"]

Fixed code:
print("YES" if sorted(input().split())==["5","5","7"] else "NO")
Buggy code:
A, B, C = map(str, input().split())

D = 0
E = 0

if A == 5:
    D += 1

if A == 7:
    E += 1

if B == 5:
    D += 1

if B == 7:
    E += 1

if C == 5:
    D += 1

if C == 7:
    E += 1

if D == 2 and E==1:
    print("YES")
else:
    print("NO")

Fixed code:
A, B, C = map(str, input().split())

D = 0
E = 0

if A == "5":
    D =D + 1

if A == "7":
    E =E + 1

if B == "5":
    D =D + 1

if B == "7":
    E =E + 1

if C == "5":
    D =D + 1

if C == "7":
    E =E + 1

if D == 2 and E == 1:
    print("YES")
else:
    print("NO")
Buggy code:
s=list(map(int,input().split())
s.sort()
if s[0]==5 and s[1]==5 and s[2]==7 :
    print("YES")
else :
    print("NO")


Fixed code:

s=list(map(int,input().split()))
s.sort()
if s[0]==5 and s[1]==5 and s[2]==7 :
    print("YES")
else :
    print("NO")