Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n, m, q = map(int, input().split())
aa = [0]*q
bb = [0]*q
cc = [0]*q
dd = [0]*q
for i in range(q):
    aa[i],bb[i],cc[i], dd[i] = list(map(int, input().split()))
    
import itertools
ss = set(itertools.permutations([0]*(n-1)+[1]*(m-1)))
score = 0
for tu in ss:
    tmp = 0
    xx = [1]*n
    j = 0
    for t in tu:
        if t == 0:
            j += 1
            xx[j] = xx[j-1]
        if t == 1:
            xx[j] += 1
    for i in range(q):
        if xx[bb[i]-1] - xx[aa[i]-1] ==cc[i]: 
            tmp += dd[i]
    score = max(score, tmp)
print(score)   

Fixed submission:
import numpy as np
from itertools import combinations_with_replacement
 
n, m, q = map(int, input().split())
 
pt = np.array(list(combinations_with_replacement(range(1,m+1), n)))
score = np.zeros(len(pt))
 
for i in range(q):
    a, b, c, d =map(int, input().split())
    flg = pt[:,b-1] - pt[:,a-1] == c
    score += flg * d
#    print(score)
 
print(int(score.max()))

Buggy python submission (verdict: Runtime Error):
m, n, q = map(int, input().split())
aa = [0]*q
bb = [0]*q
cc = [0]*q
dd = [0]*q
for i in range(q):
    aa[i],bb[i],cc[i], dd[i] = list(map(int, input().split()))
    
import itertools
ss = set(itertools.permutations([0]*(n-1)+[1]*(m-1)))
score = 0
for tu in ss:
    tmp = 0
    xx = [1]*n
    j = 0
    for t in tu:
        if t == 0:
            j += 1
        if t == 1:
            xx[j] += 1
    for i in range(q):
        if xx[bb[i]-1] - xx[aa[i]-1] ==cc[i]: 
            tmp += dd[i]
    score = max(score, tmp)
print(score)    

Fixed submission:
import numpy as np
from itertools import combinations_with_replacement
 
n, m, q = map(int, input().split())
 
pt = np.array(list(combinations_with_replacement(range(1,m+1), n)))
score = np.zeros(len(pt))
 
for i in range(q):
    a, b, c, d =map(int, input().split())
    flg = pt[:,b-1] - pt[:,a-1] == c
    score += flg * d
#    print(score)
 
print(int(score.max()))
Buggy python submission (verdict: Runtime Error):
import math
x = int(input())
finished = False
# b >= 0 check
a = max(0,int(math.pow(x,0.2)) - 1)
while a**5 - (a-1)**5 <= x:
    tmp = a**5 - x
    if tmp < 0:
        a += 1
        continue
    b = int(math.pow(tmp,0.2))
    if a**5 - b**5 == x:
        finished = True
        print(a,b)
        break
    a += 1
if not finished:
    a = 1
    while a**5 < x:
        tmp = x - a**5
        b = int(math.pow(tmp,0.2))
        if a**5 + b**5 == x:
            finished = True
            print(a,-b)
            break
        a += 1
        

Fixed submission:
a, b, n = map(int, input().split())
val = (a*n)//b - a*(n//b)
m = max(0,(n//b)*b-1)
val = max(val, (a*m)//b - a*(m//b))
print(val)

Buggy python submission (verdict: Runtime Error):
a, b, n = map(int, input().split())
val = max(0, (a*n)//b - a*(n//b), (a*m)//b - a*(m//b), (n//b)*b-1)
print(val)

Fixed submission:
a, b, n = map(int, input().split())
val = (a*n)//b - a*(n//b)
m = max(0,(n//b)*b-1)
val = max(val, (a*m)//b - a*(m//b))
print(val)

Buggy python submission (verdict: Runtime Error):
a, b, n = map(int, input().split())
val = (a*n)//b - a*(n//b)
val = max(val, (a*m)//b - a*(m//b))
print(val)

Fixed submission:
a, b, n = map(int, input().split())
val = (a*n)//b - a*(n//b)
m = max(0,(n//b)*b-1)
val = max(val, (a*m)//b - a*(m//b))
print(val)

Buggy python submission (verdict: Runtime Error):
val = a*n//b
for i in range(max(0,n//b - a), n//b):
    m = b*i - 1
    if (m > n) or (m < 0):
        continue
    else:
        val = max(val, (m*a)//b - i)
for i in range(max(0,n//b - a), n//b):
    m = b*i - 1
    if (m > n) or (m < 0):
        continue
    else:
        val = max(val, (m*a)//b - i)
        
print(val)

Fixed submission:
a, b, n = map(int, input().split())
val = (a*n)//b - a*(n//b)
m = max(0,(n//b)*b-1)
val = max(val, (a*m)//b - a*(m//b))
print(val)
Buggy python submission (verdict: Time Limit Exceeded):
from numpy import gcd 
k = int(input())
sss = 0
for a in range(1,k+1):
    for b in range(a+1,k+1):
        tmp = gcd(a,b)
        sss += 6*tmp
        for c in range(b+1,k+1):
            sss += 6*gcd(tmp,c)
sss += k*(k+1)//2
print(sss)

Fixed submission:
from math import gcd 
k = int(input())
sss = 0
for a in range(1,k+1):
    for b in range(a+1,k+1):
        tmp = gcd(a,b)
        sss += 6*tmp
        for c in range(b+1,k+1):
            sss += 6*gcd(tmp,c)
sss += k*(k+1)//2
print(sss)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

k = int(input())
sss = 0
for a in range(1,k+1):
    for b in range(a+1,k+1):
        tmp = np.gcd(a,b)
        sss += 6*tmp
        for c in range(b+1,k+1):
            sss += 6*np.gcd(tmp,c)
sss += k*(k+1)//2
print(sss)


Fixed submission:
from math import gcd 
k = int(input())
sss = 0
for a in range(1,k+1):
    for b in range(a+1,k+1):
        tmp = gcd(a,b)
        sss += 6*tmp
        for c in range(b+1,k+1):
            sss += 6*gcd(tmp,c)
sss += k*(k+1)//2
print(sss)
Buggy python submission (verdict: Runtime Error):
input()
aa = map(int, input().split())

bb = [0] * len(aa)
bb[0] = aa[0]
bb[1] = aa[1]
for i in range(2,len(aa)):
    bb[i] = bb[i-2] + aa[i]

sum0 = bb[len(aa)-2]
sum1 = bb[len(aa)-1]
ret = sum1
if len(aa)%2 == 0:
    ret = max(ret, sum0)
if len(aa)%2:
    sum0 = bb[len(aa)-1]
    sum1 = bb[len(aa)-2]
    for i in range(len(aa)//2):
        ret = max(ret, sum0 - aa[2*i])

# 0 -> 1
for i in range(0,len(aa)//2):
    try:
#        print(i, bb[2*i] - bb[2*i+3] + sum1 + aa[2*i+3])
        ret = max(ret, bb[i] - bb[i+3] + sum1 + aa[i+3] )
    except:
        0
# 1 -> 0
for i in range(0,len(aa)//2):
    try:
#        print(i, bb[2*i+1] - bb[2*i+4] + sum0 + aa[2*i+4])
        ret = max(ret, bb[2*i+1] - bb[2*i+4] + sum0 + aa[2*i+4] )
    except:
        0
print(ret)

Fixed submission:
input()
aa = list(map(int, input().split()))
state = {(0,False)}
skipmax = len(aa)%2 + 1
state_all = {(i, True) for i in range(skipmax+1)}.union({(j, False) for j in range(skipmax+1)})
dp_0 = {a:None for a in state_all }
dp_0[(0,False)] = 0
skipcount = 0

def getmax(a, b):
    if a is None:
        return b
    if b is None:
        return a
    return max(a,b)

for i,a in enumerate(aa):
    dp_1 = {}
    for s in state_all:
        if s[1] & (dp_0[(s[0], False)] is not None):
            dp_1[s] = dp_0[(s[0], False)] + a
            continue
        dp_1[s] = getmax(dp_0[(s[0], True)], dp_0.get((s[0]-1, False), None))
    dp_0 = dp_1.copy()
if len(aa)%2:
    print(getmax(dp_0[(2,True)], dp_0[(1,False)]))
else:
    print(getmax(dp_0[(1,True)], dp_0[(0,False)]))

Buggy python submission (verdict: Runtime Error):
bb = [0] * len(aa)
bb[0] = aa[0]
bb[1] = aa[1]
for i in range(2,len(aa)):
    bb[i] = bb[i-2] + aa[i]

sum0 = bb[len(aa)-2]
sum1 = bb[len(aa)-1]
ret = sum1
if len(aa)%2 == 0:
    ret = max(ret, sum0)
if len(aa)%2:
    sum0 = bb[len(aa)-1]
    sum1 = bb[len(aa)-2]
    for i in range(len(aa)//2):
        ret = max(ret, sum0 - aa[2*i])

# 0 -> 1
for i in range(0,len(aa)//2):
    try:
#        print(i, bb[2*i] - bb[2*i+3] + sum1 + aa[2*i+3])
        ret = max(ret, bb[i] - bb[i+3] + sum1 + aa[i+3] )
    except:
        0
# 1 -> 0
for i in range(0,len(aa)//2):
    try:
#        print(i, bb[2*i+1] - bb[2*i+4] + sum0 + aa[2*i+4])
        ret = max(ret, bb[2*i+1] - bb[2*i+4] + sum0 + aa[2*i+4] )
    except:
        0
print(ret)

Fixed submission:
input()
aa = list(map(int, input().split()))
state = {(0,False)}
skipmax = len(aa)%2 + 1
state_all = {(i, True) for i in range(skipmax+1)}.union({(j, False) for j in range(skipmax+1)})
dp_0 = {a:None for a in state_all }
dp_0[(0,False)] = 0
skipcount = 0

def getmax(a, b):
    if a is None:
        return b
    if b is None:
        return a
    return max(a,b)

for i,a in enumerate(aa):
    dp_1 = {}
    for s in state_all:
        if s[1] & (dp_0[(s[0], False)] is not None):
            dp_1[s] = dp_0[(s[0], False)] + a
            continue
        dp_1[s] = getmax(dp_0[(s[0], True)], dp_0.get((s[0]-1, False), None))
    dp_0 = dp_1.copy()
if len(aa)%2:
    print(getmax(dp_0[(2,True)], dp_0[(1,False)]))
else:
    print(getmax(dp_0[(1,True)], dp_0[(0,False)]))
Buggy python submission (verdict: Runtime Error):
n, r = map(int, input().split())
if n >=10:
    print(r)
else:
    print(r + 100*(10-n))

Fixed submission:
a,b,c = input().split()
print(c,a,b)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
aa = map(int, input().split())
thre = sum(aa) / (4*m)
cnt = 0
for a in aa:
  if a >= thre
  cnt  +=1
if cnt >= m:
  print('Yes')
else:
  print('No')


Fixed submission:
n, m = map(int, input().split())
aa = list(map(int, input().split()))
thre = sum(aa) / (4*m)
cnt = 0
for a in aa:
  if a >= thre:
    cnt +=1
if cnt >= m:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
k = int(input())
anss = [1,2,3,4,5,6,7,8,9]
for i in range(12):
    if len(anss) > k:
        print(new_anss[k-1])
        break
    new_anss = []
    for ans in anss:
        if ans % 10 != 0:
            new_anss += [ans*10+ans%10-1]
        new_anss += [ans*10+ans%10]
        if ans % 10 != 9:
            new_anss += [ans*10+ans%10+1]
    k -= len(anss)
    anss = new_anss

Fixed submission:
k = int(input())
anss = [1,2,3,4,5,6,7,8,9]
for i in range(12):
    if len(anss) > k:
        print(anss[k-1])
        break
    new_anss = []
    for ans in anss:
        if ans % 10 != 0:
            new_anss += [ans*10+ans%10-1]
        new_anss += [ans*10+ans%10]
        if ans % 10 != 9:
            new_anss += [ans*10+ans%10+1]
    k -= len(anss)
    anss = new_anss

Buggy python submission (verdict: Runtime Error):
k = int(input())
anss = [1,2,3,4,5,6,7,8,9]
for i in range(12):
    if len(anss) > k:
        print(new_anss[k-1])
        break
    new_anss = []
    for ans in anss:
        if ans % 10 != 0:
            new_anss += [ans*10+ans%10-1]
        new_anss += [ans*10+ans%10]
        if ans % 10 != 9:
            new_anss += [ans*10+ans%10+1]
    k -= len(anss)
    anss = new_anss

Fixed submission:
k = int(input())
anss = [1,2,3,4,5,6,7,8,9]
for i in range(12):
    if len(anss) > k:
        print(anss[k-1])
        break
    new_anss = []
    for ans in anss:
        if ans % 10 != 0:
            new_anss += [ans*10+ans%10-1]
        new_anss += [ans*10+ans%10]
        if ans % 10 != 9:
            new_anss += [ans*10+ans%10+1]
    k -= len(anss)
    anss = new_anss

Buggy python submission (verdict: Runtime Error):
k = int(input())
anss = [1,2,3,4,5,6,7,8,9]
for i in range(12):
    if len(anss) > k:
        print(new_anss[k-1])
        break
    new_anss = []
    for ans in anss:
        if ans % 10 != 0:
            new_anss += [ans*10+ans-1]
        new_anss += [ans*10+ans]
        if ans % 10 != 9:
            new_anss += [ans*10+ans+1]
    k -= len(anss)
    anss = new_anss

Fixed submission:
k = int(input())
anss = [1,2,3,4,5,6,7,8,9]
for i in range(12):
    if len(anss) > k:
        print(anss[k-1])
        break
    new_anss = []
    for ans in anss:
        if ans % 10 != 0:
            new_anss += [ans*10+ans%10-1]
        new_anss += [ans*10+ans%10]
        if ans % 10 != 9:
            new_anss += [ans*10+ans%10+1]
    k -= len(anss)
    anss = new_anss
Buggy python submission (verdict: Time Limit Exceeded):
input()
aa = list(map(int, input().split()))
uu = list(set(aa))
cc = uu.copy()
total = 0
for i in range(len(uu)):
    cc[i] = aa.count(uu[i])
    total += cc[i] * (cc[i]-1) / 2

dic = dict(zip(uu,cc))

for a in aa:
    print(int(total - dic[a] + 1))

Fixed submission:
input()
from collections import Counter
aa = list(map(int, input().split()))
dic = Counter(aa)

total = 0
for v in dic.values():
    total += v * (v-1) / 2

for a in aa:
    print(int(total - dic[a] + 1))

Buggy python submission (verdict: Runtime Error):
input()
aa = list(map(int, input().split()))
uu = list(set(aa))
cc = uu.copy()
for i in range(len(uu)):
    cc[i] = aa.count(uu[i])
    total += cc[i] * (cc[i]-1) / 2

dic = dict(zip(uu,cc))

for a in aa:
    print(int(total - dic[a] + 1))

Fixed submission:
input()
from collections import Counter
aa = list(map(int, input().split()))
dic = Counter(aa)

total = 0
for v in dic.values():
    total += v * (v-1) / 2

for a in aa:
    print(int(total - dic[a] + 1))

Buggy python submission (verdict: Time Limit Exceeded):
input()
aa = list(map(int, input().split()))
uu = list(set(aa))
cc = uu.copy()
for i in range(len(uu)):
    cc[i] = aa.count(uu[i])
dic = dict(zip(uu,cc))
total = 0
for v in cc:
    total += v * (v-1) / 2

for a in aa:
    print(int(total - dic[a] + 1))

Fixed submission:
input()
from collections import Counter
aa = list(map(int, input().split()))
dic = Counter(aa)

total = 0
for v in dic.values():
    total += v * (v-1) / 2

for a in aa:
    print(int(total - dic[a] + 1))

Buggy python submission (verdict: Time Limit Exceeded):
input()
aa = list(map(int, input().split()))
uu = list(set(aa))
cc = []
for u in list(uu):
    cc += [aa.count(u)]
dic = dict(zip(uu,cc))
total = 0
for v in list(cc):
    total += v * (v-1) / 2

#if aa.ndim == 0:
#    aa = [aa]    
    
for a in aa:
    print(int(total - dic[a] + 1))

Fixed submission:
input()
from collections import Counter
aa = list(map(int, input().split()))
dic = Counter(aa)

total = 0
for v in dic.values():
    total += v * (v-1) / 2

for a in aa:
    print(int(total - dic[a] + 1))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
input()
aa = list(map(int, input().split()))
uu = list(set(aa))
cc = []
for u in list(uu):
    cc += [aa.count(u)]
dic = dict(zip(uu,cc))
total = 0
for v in list(cc):
    total += v * (v-1) / 2
    
for a in aa:
    print(int(total - dic[a] + 1))

Fixed submission:
input()
from collections import Counter
aa = list(map(int, input().split()))
dic = Counter(aa)

total = 0
for v in dic.values():
    total += v * (v-1) / 2

for a in aa:
    print(int(total - dic[a] + 1))
Buggy python submission (verdict: Time Limit Exceeded):
s = str(input())
q = int(input())
inv = False
for i in range(q):
    a = input()
    if a == '1':
        inv = not inv
        continue
    a = a.split()
    if (a[1] == '1')^inv:
        s = a[2] + s
    else:
        s += a[2]
if inv:
    print(s[::-1])
else:
    print(s)

Fixed submission:
s = str(input())
q = int(input())
inv = False
head = ''
tail = ''

for i in range(q):
    a = input()
    if a == '1':
        inv = not inv
        continue
    a = a.split()
    if (a[1] == '1')^inv:
        head = a[2] + head
    else:
        tail += a[2]
s = head + s + tail
if inv:
    print(s[::-1])
else:
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
inv = False
for i in range(q):
    a = list(input().split())
    if a[0] == '1':
        inv = not inv
    if a[0] == '2':
        if (a[1] == '1')^inv:
            s = a[2] + s
        else:
            s += a[2]
if inv:
    print(s[::-1])
else:
    print(s)

Fixed submission:
s = str(input())
q = int(input())
inv = False
head = ''
tail = ''

for i in range(q):
    a = input()
    if a == '1':
        inv = not inv
        continue
    a = a.split()
    if (a[1] == '1')^inv:
        head = a[2] + head
    else:
        tail += a[2]
s = head + s + tail
if inv:
    print(s[::-1])
else:
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())

for i in range(q):
    a = list(input().split())
    if a[0] == '1':
        s = s[::-1]
    if a[0] == '2':
        if a[1] == '1':
            s = a[2] + s
        else:
            s += a[2]
print(s)

Fixed submission:
s = str(input())
q = int(input())
inv = False
head = ''
tail = ''

for i in range(q):
    a = input()
    if a == '1':
        inv = not inv
        continue
    a = a.split()
    if (a[1] == '1')^inv:
        head = a[2] + head
    else:
        tail += a[2]
s = head + s + tail
if inv:
    print(s[::-1])
else:
    print(s)
Buggy python submission (verdict: Runtime Error):
a = input().split()
n = int(a[0])
m = int(a[1])

d = {}
ret = True
for i in range(m):
  a = input().split()
  s = int(a[0])
  c = int(a[1])
  if (d.get(s,-1) != -1) & (d.get(s,-1) != c):
    ret = False
  if (s == 1) & (c == 0):
    ret = False
  if s > n:
    ret = False
  d[s] = c

p = ""    
for i in range(1,n+1):
  if d.get(i,-1) == -1:
    if (i == 1) & (n >1):
      p += "1"
    else:
      p += "0"
  else:
    p += str(d[i])
if ret:
  print(p)
else:
  print("-1")

Fixed submission:
a = int(input())
print((a + 1)//2)
Buggy python submission (verdict: Runtime Error):
a = input().split()
a += input().split()
a += input().split()
n = int(input())
b = set([(int)(input()) for i in range(n)])

bingo = False
if set([a[0], a[1], a[2]).issubset(b):
	bingo = True
if set([a[3], a[4], a[5]).issubset(b):
	bingo = True
if set([a[6], a[7], a[8]).issubset(b):
	bingo = True
if set([a[0], a[3], a[6]).issubset(b):
	bingo = True
if set([a[1], a[4], a[7]).issubset(b):
	bingo = True
if set([a[2], a[5], a[8]).issubset(b):
	bingo = True
if set([a[0], a[4], a[8]).issubset(b):
	bingo = True
if set([a[2], a[4], a[6]).issubset(b):
	bingo = True
print(bingo)

Fixed submission:
a = input().split()
a += input().split()
a += input().split()
n = int(input())
b = set([(input()) for i in range(n)])

bingo = False
if set([a[0], a[1], a[2]]).issubset(b):
	bingo = True
if set([a[3], a[4], a[5]]).issubset(b):
	bingo = True
if set([a[6], a[7], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[3], a[6]]).issubset(b):
	bingo = True
if set([a[1], a[4], a[7]]).issubset(b):
	bingo = True
if set([a[2], a[5], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[4], a[8]]).issubset(b):
	bingo = True
if set([a[2], a[4], a[6]]).issubset(b):
	bingo = True
if bingo:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
mod = 10 **9 +7
fac = [1] * 200000
inv = [1] * 200000
for i in range(1,len(fac)):
    fac[i] = fac[i-1] * i % mod
    inv[i] = pow(fac[i], mod-2, mod)

facna = 1
facnb = 1
for i in range(n-a+1,n+1):
    facna = facna * i %mod
for i in range(n-b+1,n+1):
    facnb = facnb * i %mod
ret = pow(2,n,mod) - 1 - facna * inv[a] - facnb * inv[b]
ret = ret%mod
print(ret)


Fixed submission:
n, a, b = map(int, input().split())
mod = 10 **9 +7
fac = [1] * 200001
inv = [1] * 200001
for i in range(1,len(fac)):
    fac[i] = fac[i-1] * i % mod
    inv[i] = pow(fac[i], mod-2, mod)

facna = 1
facnb = 1
for i in range(n-a+1,n+1):
    facna = facna * i %mod
for i in range(n-b+1,n+1):
    facnb = facnb * i %mod
ret = pow(2,n,mod) - 1 - facna * inv[a] - facnb * inv[b]
ret = ret%mod
print(ret)
Buggy python submission (verdict: Runtime Error):
n = int(input())
nums = [int(i) for i in input().split(" ")]

approved = True
for num in nums:
  if num%2 == 0:
    approved = (num%3 == 0) | (num%5 == 0)
if approved:
  print('APPROVED')
else:
  print('DENIED')
  

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

if (a == b) and (b == c):
  print('No')
elif (a == b) or (b == c) or (a == c):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
nums = [int(i) for i in input().split(" ")]

approved = True
for num in nums:
  if num%2 == 0:
    approved = (num%3 == 0) or (num%5 == 0)
if approved:
  print('APPROVED')
else:
  print('DENIED')
  

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

if (a == b) and (b == c):
  print('No')
elif (a == b) or (b == c) or (a == c):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
nums = [int(i) for i in input().split(" ")]

approved = True
for num in nums:
  if num%2 == 0:
    approved = (num%3 == 0) or (num%5 == 0)
if approved:
  print('APPROVED')
else:
  print('DENIED')
  

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

if (a == b) and (b == c):
  print('No')
elif (a == b) or (b == c) or (a == c):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

if (a == b) and (b == c):
  print('No')
  return
elif (a == b) or (b == c):
  print('Yes')
  return
else:
  print('No')
  

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

if (a == b) and (b == c):
  print('No')
elif (a == b) or (b == c) or (a == c):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
return 'No'

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

if (a == b) and (b == c):
  print('No')
elif (a == b) or (b == c) or (a == c):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
 
s = [str(input()) for i in range(n)]

set_key = set(s)
dic = dict(set_key, [0]*len(set_key))

for c in s:
  dic[c] += 1
  
n_max = max(dic.values())
str_argmax = dic.keys()[dic.values() == n_max]
str_argmax.sort()

for i in str_argmax:
  print(i)

Fixed submission:
n = int(input())
 
s = [str(input()) for i in range(n)]

set_key = list(set(s))
set_key.sort()
dic = dict(zip(set_key, [0]*len(set_key)))

for c in s:
  dic[c] += 1

n_max = max(dic.values())

for c in set_key:
  if dic[c] == n_max:
    print(c)
Buggy python submission (verdict: Runtime Error):
a = input()

cnt = 0
sakki5 = False
for s in a:
    if int(s) < 6:
        cnt += int(s)
        sakki6 = False
        if int(s) == 5:
            sakki5 = True
    else:
        cnt += 11 - int(s)
        if sakki6:
            cnt -= 2
        if sakki5:
            cnt -= 1
        sakki6 = True
        sakki5 = False
print(cnt)

Fixed submission:
s = input()
state = [0, 1]
for i in s:
    n = int(i)
    state_new = [min(state[0] + n, state[1] + 10 - n), 
                 min(state[0] + n + 1, state[1] + 9 - n)]
    state = state_new
print(state[0])

Buggy python submission (verdict: Runtime Error):
s = input()
cnt = 0
sakki5 = False
for s in a:
    if int(s) < 6:
        cnt += int(s)
        sakki6 = False
        if int(s) == 5:
            sakki5 = True
    else:
        cnt += 11 - int(s)
        if sakki6:
            cnt -= 2
        if sakki5:
            cnt -= 1
        sakki6 = True
        sakki5 = False
cnt

Fixed submission:
s = input()
state = [0, 1]
for i in s:
    n = int(i)
    state_new = [min(state[0] + n, state[1] + 10 - n), 
                 min(state[0] + n + 1, state[1] + 9 - n)]
    state = state_new
print(state[0])
Buggy python submission (verdict: Runtime Error):
N = int(input())

dic = {}
for i in range(1,10):
  for j in range(1,10):
    dic[(str(i),str(j))] = 0

for i in range(N):
  nstr = str(i)
  pre = nstr[0]
  suf = nstr[-1]
  if suf == '0':
    continue
  dic[(pre, suf)] =dic[(pre, suf)] + 1

cnt = 0 
for i in range(1,10):
  for j in range(1,10):
    cnt += dic[(str(i),str(j))] * dic[(str(j),str(i))]

print(cnt)

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

if M == N:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
M, N = map(int, input().split())

if M > N:
  body = N
  numm = M
else:
  body = M
  numm = N

ret = ''
for i in numm:
  ret += str(body)
print(ret)

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

if M > N:
  body = N
  numm = M
else:
  body = M
  numm = N

ret = ''
for i in range(numm):
  ret += str(body)
print(ret)