Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter, deque

N = int(input())
A = deque(map(int, input().split()))
B = deque(map(int, input().split()))

ca, cb = Counter(A), Counter(B)

cab = ca+cb

if any(c > N for c in cab.values()):
    print('No')
else:
    print('Yes')
    B.reverse()
    res = []
    while A:
        if A[0] != B[0]:
            A.popleft()
            res.append(str(B.popleft()))
        else:
            B.rotate()
        
    print(' '.join(res))

Fixed submission:
from collections import Counter, deque

N = int(input())
A = deque(map(int, input().split()))
B = deque(map(int, input().split()))

ca, cb = Counter(A), Counter(B)

cab = ca+cb

if any(c > N for c in cab.values()):
    print('No')
else:
    print('Yes')
    B.rotate(N//2)
    res = []
    while A:
        if A[0] != B[0]:
            A.popleft()
            res.append(str(B.popleft()))
        else:
            B.rotate()
        
    print(' '.join(res))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter, deque

N = int(input())
A = deque(map(int, input().split()))
B = deque(map(int, input().split()))

ca, cb = Counter(A), Counter(B)

cab = ca+cb

if any(c > N for c in cab.values()):
    print('No')
else:
    print('Yes')
    for _ in range(N):
        if all(a != b for a, b in zip(A, B)):
            print(' '.join(str(i) for i in B))
            break
        
        B.rotate()

Fixed submission:
from collections import Counter, deque

N = int(input())
A = deque(map(int, input().split()))
B = deque(map(int, input().split()))

ca, cb = Counter(A), Counter(B)

cab = ca+cb

if any(c > N for c in cab.values()):
    print('No')
else:
    print('Yes')
    B.rotate(N//2)
    res = []
    while A:
        if A[0] != B[0]:
            A.popleft()
            res.append(str(B.popleft()))
        else:
            B.rotate()
        
    print(' '.join(res))
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
X = input()
px = X.count('1')

def xmod(m):
    res = []
    mod = 1
    for s in reversed(X):
        res.append(mod)
        mod = (mod * 2) % m
    
    return list(reversed(res))

plus = xmod(px+1)
minus = xmod(px-1)
sp = sum(plus)
sm = sum(minus)

for i in range(N):
    if X[i] == '0':
        sum_ = (sp - plus[i]) % (px+1)
        if sum_ == 0:
            print(0)
        else:
            cnt = 0
            while sum_ == 0:
                cnt += 1
                sum_ = sum_ % popcpunt(sum_)
            print(cnt)
    else:
        sum_ = (sm - minus[i]) % (px-1)
        if sum_ == 0:
            print(0)
        else:
            cnt = 0
            while sum_ == 0:
                cnt += 1
                sum_ = sum_ % popcpunt(sum_)
            print(cnt)
      
def popcount(x):
    x = x - ((x >> 1) & 0x5555555555555555)

    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)

    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f # 8bitごと
    x = x + (x >> 8) # 16bitごと
    x = x + (x >> 16) # 32bitごと
    x = x + (x >> 32) # 64bitごと = 全部の合計
    return x & 0x0000007f


Fixed submission:
L, R, d = map(int, input().split())

n = R-L+1
print(sum(1 if i%d == 0 else 0 for i in range(L, L+n)))

Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
from collections import Counter

N = int(input())

if N == 1:
    print(0)
else:
    xyz_lim = int(math.sqrt(N-2)) - 1

    def f(x, y, z):
        return ((x+y)**2 + (y+z)**2 + (z+x) ** 2) // 2

    cnt = Counter()
    for _x in range(xyz_lim):
        for _y in range(xyz_lim):
            x, y = _x+1, _y+1
            cnt.update([f(x, y, _z+1) for _z in range(xyz_lim)])

    for _n in range(N):
        n = _n + 1
        print(cnt[n])

Fixed submission:
L, R, d = map(int, input().split())

n = R-L+1
print(sum(1 if i%d == 0 else 0 for i in range(L, L+n)))
Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
from collections import Counter

N = int(input())

xyz_lim = int(math.sqrt(N-2)) - 1

def f(x, y, z):
    return ((x+y)**2 + (y+z)**2 + (z+x) ** 2) // 2

cnt = Counter()
for _x in range(xyz_lim):
    for _y in range(xyz_lim):
        x, y = _x+1, _y+1
        cnt.update([f(x, y, _z+1) for _z in range(xyz_lim)])

for _n in range(N):
    n = _n + 1
    print(cnt[n])

Fixed submission:
import math
import numpy as np
from collections import Counter

N = int(input())

if N == 1:
    print(0)
else:
    xyz_lim = int(math.sqrt(N-2)) - 1

    def f(x, y, z):
        return ((x+y)**2 + (y+z)**2 + (z+x) ** 2) // 2

    cnt = Counter()
    for _x in range(xyz_lim):
        for _y in range(xyz_lim):
            x, y = _x+1, _y+1
            cnt.update([f(x, y, _z+1) for _z in range(xyz_lim)])

    for _n in range(N):
        n = _n + 1
        print(cnt[n])
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
ans = []
for i in c,d:
    ans.append(a*i)
for j in c,d:
    ans.append(b*j)

print(max(ans))

Fixed submission:
n = int(input())
mod = 10**9+7
print((((10**n)%mod)-(9**n%mod)-(9**n%mod)+(8**n%mod))%mod)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = 0
mod = 1000000007
for i in range(N):
  for j in range(N):
    if i < j:
      #ans += (A[i]*A[j])
      ans += (A[i]*A[j])%mod
print(ans%mod)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
mod = 10**9 + 7

s = sum(a)
ans = 0

for i in a:
  s -= i
  s %= mod
  ans += s*i
  ans %= mod
  
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(N):
  for j in range(N):
    if i < j:
      #ans += (A[i]*A[j])
      ans += (A[i]*A[j])%(10**9+7)
print(ans%(10**9+7))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
mod = 10**9 + 7

s = sum(a)
ans = 0

for i in a:
  s -= i
  s %= mod
  ans += s*i
  ans %= mod
  
print(ans)
Buggy python submission (verdict: Runtime Error):
s = int(input())
q = []
for i in s:
  q.append(i)
if sum(q)%9 == 0:
  print('Yes')
else:print('No')

Fixed submission:
s = input()
q = []
for i in s:
  q.append(int(i))
if sum(q)%9 == 0:
  print('Yes')
else:print('No')
Buggy python submission (verdict: Runtime Error):
N = int(Input())
print(N%1000)

Fixed submission:
N = int(input())
for i in range(1,11):
  if i*1000 >= N:
    print(i*1000-N)
    exit()
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
num = Counter(A)
for i in range(Q):
    b,c = map(int,input().split())
    num[c] += num[b]
    num[b] = 0
    sums = 0
    for j in num:
        sums += num[j]*j
    print(sums)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
ans = sum(A)
num = Counter(A)
for i in range(Q):
    b,c = map(int,input().split())

    ans += (c-b)*num[b]
    num[c] += num[b] 
    num[b] = 0
    
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
Q = int(input())

num = Counter(A)

for i in range(Q):
  b,c = map(int,input().split())
  num[c] += num[b]
  num[b] = 0
  ans = 0
  for i in num:
      ans += i * num[i] 
  print(ans)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
ans = sum(A)
num = Counter(A)
for i in range(Q):
    b,c = map(int,input().split())

    ans += (c-b)*num[b]
    num[c] += num[b] 
    num[b] = 0
    
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
q = int(input())

for i in range(q):
  b,c = map(int,input().split())
  for j in range(n):
    if a[j] == b:
      a[j] = c
  print(sum(a))

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
ans = sum(A)
num = Counter(A)
for i in range(Q):
    b,c = map(int,input().split())

    ans += (c-b)*num[b]
    num[c] += num[b] 
    num[b] = 0
    
    print(ans)
Buggy python submission (verdict: Runtime Error):
X,N = map(int,input().split())
if N == 0:
  print(X)
  exit()
p = list(map(int,input().split()))

l = list(range(1,101))
s = []
  
for i in p:
  l.remove(i)

for j in l:
  s.append(abs(X-j))
  
ans = min(s)

if l.count(X+ans) == 1 and l.count(X-ans) == 1:
  print(X-ans)

elif l.count(X+ans) == 1 and l.count(X-ans) != 1:
  print(X+ans)
  
elif l.count(X+ans) != 1 and l.count(X-ans) == 1:
  print(X-ans)



Fixed submission:
X,N = map(int,input().split())
if N == 0:
  print(X)
  exit()
p = list(map(int,input().split()))

l = list(range(-1,102))
s = []
  
for i in p:
  l.remove(i)

for j in l:
  s.append(abs(X-j))
  
ans = min(s)

if l.count(X+ans) == 1 and l.count(X-ans) == 1:
  print(X-ans)

elif l.count(X+ans) == 1 and l.count(X-ans) != 1:
  print(X+ans)
  
elif l.count(X+ans) != 1 and l.count(X-ans) == 1:
  print(X-ans)

Buggy python submission (verdict: Runtime Error):
X,N = map(int,input().split())
if N == 0:
  print(X)
  exit()
p = list(map(int,input().split()))

l = list(range(1,101))
s = []
  
for i in p:
  l.remove(i)

for j in l:
  s.append(abs(X-j))
  
ans = min(s)

if l.count(X+ans) == 1 and l.count(X-ans) == 1:
  print(X-ans)

elif l.count(X+ans) == 1 and l.count(X-ans) != 1:
  print(X+ans)
  
elif l.count(X+ans) != 1 and l.count(X-ans) == 1:
  print(X-ans)



Fixed submission:
X,N = map(int,input().split())
if N == 0:
  print(X)
  exit()
p = list(map(int,input().split()))

l = list(range(-1,102))
s = []
  
for i in p:
  l.remove(i)

for j in l:
  s.append(abs(X-j))
  
ans = min(s)

if l.count(X+ans) == 1 and l.count(X-ans) == 1:
  print(X-ans)

elif l.count(X+ans) == 1 and l.count(X-ans) != 1:
  print(X+ans)
  
elif l.count(X+ans) != 1 and l.count(X-ans) == 1:
  print(X-ans)
Buggy python submission (verdict: Runtime Error):
if (V*T)+A < (W*T)+B:
  print('NO')

tt =T/2
if tt%2 != 0:
    tt += 0.5

tt = int(tt)

for i in range(1,tt):
  if tt*V+A < tt*W+B:
    break
  if V*i+A >= W*i+B:
    print('YES')
    exit()

for i in range(tt,T):
  if V*i+A >= W*i+B:
    print('YES')
    exit()

Fixed submission:
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if abs(A-B) > (V*T)-(W*T):
  print('NO')
  exit()

tt =T/2
if tt%2 != 0:
    tt += 0.5

tt = int(tt)

for i in range(1,tt):
  if tt*V+A < tt*W+B:
    break
  if V*i+A >= W*i+B:
    print('YES')
    exit()

for i in range(tt,T+1):
  if V*i+A >= W*i+B:
    print('YES')
    exit()
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
print(A*B)

Fixed submission:
A,B = map(float,input().split())
a = round(B*100)
b = int(A)
print(a*b//100)

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

Fixed submission:
A,B = map(float,input().split())
a = round(B*100)
b = int(A)
print(a*b//100)
Buggy python submission (verdict: Runtime Error):
N,M,X = map(int,input().split())
books = [list(map(int,input().split())) for i in range(N)]
bag = []

for i in range(2**N):
  temp = []
  job = [0] * M
  for s in range(N):
    if (i>>s)&1:
      temp.append(s)
      for j in range(M):
        job[j] += item[s][j+1]
  for s in range(len(job)):
    if job[s]<X:
      break
  else:
    ans = 0
    for s in temp:
      ans += item[s][0]
    bag.append(ans)
print(min(bag) if len(bag)>=1 else -1)  

Fixed submission:
# coding: utf-8
N,M,X = map(int,input().split())
item = [list(map(int,input().split())) for i in range(N)]
bag = []

for i in range(2**N):
  temp = []
  job = [0] * M
  for s in range(N):
    if (i>>s)&1:
      temp.append(s)
      for j in range(M):
        job[j] += item[s][j+1]
  for s in range(len(job)):
    if job[s]<X:
      break
  else:
    ans = 0
    for s in temp:
      ans += item[s][0]
    bag.append(ans)
print(min(bag) if len(bag)>=1 else -1)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = []
ans = 0
for i in range(K):
  d = int(input())
  A = list(map(int,input().split()))
  for i in range(d):
    s.append(A[i])
  
for i in range(K):
  if s.count(i) == 0:
    ans += 1
    
print(ans)
    

Fixed submission:
n,k = map(int,input().split())
s = []
ans = 0
for i in range(k):
  d = int(input())
  A = list(map(int,input().split()))
  for i in range(d):
    s.append(A[i])

for i in range(n+1):
  if s.count(i) == 0:
    ans += 1
    
print(ans-1)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
H = list(map(int,input().split()))

l = [1] * n

for i in range(n):
  A,B = map(int,input().split())
  if H[A-1] > H[B-1]:
    l[B - 1] = 0
  elif H[A - 1] < H[B - 1]:
    l[A - 1] = 0
  elif H[A - 1] == H[B - 1]:
    l[A - 1], l[B - 1] = 0, 0
print(l.count(1))


Fixed submission:
N, M = map(int, input().split())
H = list(map(int, input().split()))
l = [1] * N
for i in range(M):
    A, B = map(int, input().split())
    if H[A - 1] > H[B - 1]:
        l[B - 1] = 0
    elif H[A - 1] < H[B - 1]:
        l[A - 1] = 0
    elif H[A - 1] == H[B - 1]:
        l[A - 1], l[B - 1] = 0, 0
print(l.count(1))

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

l = [1] * N

for i in range(n):
  A,B = map(int,input().split())
  if H[A-1] > h[B-1]:
    l[B - 1] = 0
  elif H[A - 1] < H[B - 1]:
    l[A - 1] = 0
  elif H[A - 1] == H[B - 1]:
    l[A - 1], l[B - 1] = 0, 0
print(l.count(1))


Fixed submission:
N, M = map(int, input().split())
H = list(map(int, input().split()))
l = [1] * N
for i in range(M):
    A, B = map(int, input().split())
    if H[A - 1] > H[B - 1]:
        l[B - 1] = 0
    elif H[A - 1] < H[B - 1]:
        l[A - 1] = 0
    elif H[A - 1] == H[B - 1]:
        l[A - 1], l[B - 1] = 0, 0
print(l.count(1))

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

l = [1] * N

for i in range(M):
  A,B = map(int,input().split())
  if h[A-1] > h[B-1]:
    l[B - 1] = 0
  elif H[A - 1] < H[B - 1]:
    l[A - 1] = 0
  elif H[A - 1] == H[B - 1]:
    l[A - 1], l[B - 1] = 0, 0
print(l.count(1))


Fixed submission:
N, M = map(int, input().split())
H = list(map(int, input().split()))
l = [1] * N
for i in range(M):
    A, B = map(int, input().split())
    if H[A - 1] > H[B - 1]:
        l[B - 1] = 0
    elif H[A - 1] < H[B - 1]:
        l[A - 1] = 0
    elif H[A - 1] == H[B - 1]:
        l[A - 1], l[B - 1] = 0, 0
print(l.count(1))

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

l = [0] * N

for i in range(M):
  A,B = map(int,input().split())
  if h[A-1] > h[B-1]:
    l[B - 1] = 0
  elif H[A - 1] < H[B - 1]:
    l[A - 1] = 0
  elif H[A - 1] == H[B - 1]:
    l[A - 1], l[B - 1] = 0, 0
print(l.count(1))

Fixed submission:
N, M = map(int, input().split())
H = list(map(int, input().split()))
l = [1] * N
for i in range(M):
    A, B = map(int, input().split())
    if H[A - 1] > H[B - 1]:
        l[B - 1] = 0
    elif H[A - 1] < H[B - 1]:
        l[A - 1] = 0
    elif H[A - 1] == H[B - 1]:
        l[A - 1], l[B - 1] = 0, 0
print(l.count(1))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
c = input().split()

  
for i in range(N):
  print(c.count(str(i+1)))
  

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
b = [0]*N

for i in range(N-1):
  b[a[i]-1]+=1
  #print(a[i]-1)

for i in range(N):
  print(b[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
M = list(map(int,input().split()))

a = N/2

if a%2 == 1:
  a += 0.5
  
a = int(a)
for i in range(1,a):
  print(M.count(i))
  
for i in range(a,N+1):
  print(M.count(i))

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
b = [0]*N

for i in range(N-1):
  b[a[i]-1]+=1
  #print(a[i]-1)

for i in range(N):
  print(b[i])

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

a = N/2

if a%2 == 1:
    a += 0.5
    a = int(a)

for i in range(1,a):
  print(M.count(i))
  
for i in range(a,N+1):
    print(M.count(i))

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
b = [0]*N

for i in range(N-1):
  b[a[i]-1]+=1
  #print(a[i]-1)

for i in range(N):
  print(b[i])
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n.count(7) != 0:
  print('Yes')
  exit()
  
print('No')

Fixed submission:
n = str(input())

if n.count('7') != 0:
  print('Yes')
  exit()
  
print('No')
Buggy python submission (verdict: Runtime Error):
 = list(map(int,input().split()))
m = []
for i in range(2):
    m.append(n[i])
    n.pop(i)
    n.append(m[i])
  
for i in range(3):
  print(str(n[i]) + ' ',end='')

Fixed submission:
n = list(map(int,input().split()))
m = []
for i in range(2):
    m.append(n[0])
    n.pop(0)
    
n.append(m[0])
n.append(m[1])
  
print(*n)

Buggy python submission (verdict: Runtime Error):
n = [map(int,input().split())]
for i in range(2):
  n.pop(i)
  n.append(n[i])
  
for i in range(3):
  print(n[i],end='')

Fixed submission:
n = list(map(int,input().split()))
m = []
for i in range(2):
    m.append(n[0])
    n.pop(0)
    
n.append(m[0])
n.append(m[1])
  
print(*n)
Buggy python submission (verdict: Runtime Error):
s = input()
a = s.sort()
if s != s.sort():
  print('No')
  exit()
  
if s[0:len(s)//2] == a[0:len(s)//2]:
  print('Yes')
else:
  print('No')

Fixed submission:
s = input()

def kaibun(s):
    if s == s[::-1]:
        return 1
    else:
        return 0
        
q = len(s)
d = int((q-1)/2)
ket = s[0:d]
mat = s[int((q+1)/2):q]

if (kaibun(s) + kaibun(ket) + kaibun(mat)) == 3:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
ans = 0
q = 0
A = 'Blue'
if a == 0:
  print(0)
  exit()
  
for i in range(n):
  if i % 2 == 0:
    ans += a
    q += a
    A = 'Blue'
  if i % 2 != 0:
    q += b
    A = 'Red'
  if q > n:
    break
    
if A == 'Red':
  print(ans)
  
if A == 'Blue':
  print(ans-(q-n))


Fixed submission:
n,a,b = map(int,input().split())
ans = 0
q = n // (a+b)

ans += q*a
q = n - (a+b)*q

if q - a >= 0:
    ans += a
if q - a < 0:
    ans = ans + a +(q-a)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
ans = 0
q = 0
A = 'Blue'
if a == 0:
  print(0)
  exit()
  
for i in range(n):
  if i % 2 == 0:
    ans += a
    q += a
    A = 'Blue'
  if i % 2 != 0:
    q += b
    A = 'Red'
  if q > n:
    break
    
if A == 'Red':
  print(ans)
  
if A == 'Blue':
  print(ans-(q-n))

Fixed submission:
n,a,b = map(int,input().split())
ans = 0
q = n // (a+b)

ans += q*a
q = n - (a+b)*q

if q - a >= 0:
    ans += a
if q - a < 0:
    ans = ans + a +(q-a)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
q = list()
for i in range(1009):
  if int(i*0.08) == a and int(i*0.1) == b:
    q.append(i)

if len(q) == 0:
  print(-1)
print(min(q))

Fixed submission:
a,b = map(int,input().split())
q = list()
for i in range(1009):
  if int(i*0.08) == a and int(i*0.1) == b:
    q.append(i)

if len(q) == 0:
  print(-1)
  exit()
print(min(q))
Buggy python submission (verdict: Runtime Error):
l = [map(int,input().split()) for i in range(3)]
N = int(input())
q = [int(input()) for i in range(N)]

for i in range(3):
  for j in range(3):
    for k in range(N):
      if l[i][j] == q[k]:
        l[i][j] == 0
        
      if l[0][0] == 0 and l[0][1] == 0 and l[0][2] == 0:
        print('Yes')
        exit()
      elif l[1][0] == 0 and l[1][1] == 0 and l[1][2] == 0:
        print("Yes")
        exit()
      elif l[2][0] == 0 and l[2][1] == 0 and l[2][2] == 0:
        print("Yes")
        exit()
      elif l[0][0] == 0 and l[1][1] == 0 and l[2][2] == 0:
        print("Yes")
        exit()
      elif l[0][2] == 0 and l[1][1] == 0 and l[2][0] == 0:
        print("Yes")
        exit()
      elif l[0][0] == 0 and l[1][0] == 0 and l[2][0] == 0:
        print("Yes")
        exit()
      elif l[0][1] == 0 and l[1][1] == 0 and l[2][1] == 0:
        print("Yes")
        exit()
      elif l[0][2] == 0 and l[1][2] == 0 and l[2][2] == 0:
        print("Yes")
        exit()
      
print('No')

Fixed submission:
l = [list(map(int,input().split())) for i in range(3)]
N = int(input())
q = [int(input()) for i in range(N)]

for i in range(3):
  for j in range(3):
    for k in range(N):

      if l[i][j] == q[k]:
        l[i][j] = 0
        
      if l[0][0] == 0 and l[0][1] == 0 and l[0][2] == 0:
        print('Yes')
        exit()
      elif l[1][0] == 0 and l[1][1] == 0 and l[1][2] == 0:
        print("Yes")
        exit()
      elif l[2][0] == 0 and l[2][1] == 0 and l[2][2] == 0:
        print("Yes")
        exit()
      elif l[0][0] == 0 and l[1][1] == 0 and l[2][2] == 0:
        print("Yes")
        exit()
      elif l[0][2] == 0 and l[1][1] == 0 and l[2][0] == 0:
        print("Yes")
        exit()
      elif l[0][0] == 0 and l[1][0] == 0 and l[2][0] == 0:
        print("Yes")
        exit()
      elif l[0][1] == 0 and l[1][1] == 0 and l[2][1] == 0:
        print("Yes")
        exit()
      elif l[0][2] == 0 and l[1][2] == 0 and l[2][2] == 0:
        print("Yes")
        exit()

print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a==b==c or a!=b!=c!=:
  print('No')
else:
  print('Yes')

Fixed submission:
a,b,c = map(int,input().split())
if a==b and b!=c:
    print('Yes')
elif a==c and a!=b:
    print('Yes')
elif b==c and b!=a:print('Yes')
else:print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
q = list(map(int,input().split()))
alm = 0
for i in q:
  if i%2 == 0:
    alm = i
  	if alm%3 != 0 or alm%5 != 0:
    	print("DENIED")
        exit()

print("APPROVED")
  


Fixed submission:
n = int(input())
q = list(map(int,input().split()))
ans = 0
count = 0
for i in q:
    if i%2 == 0:
        alm = i
        count += 1
        if alm%3 == 0 or alm%5 == 0:
            ans += 1
if ans == count:
    print("APPROVED")
else:
    print("DENIED")

Buggy python submission (verdict: Runtime Error):
n = int(input())
q = list(map(int,input().split()))
alm = 0
for i in q:
  ans = []
  if i%2 == 0:
    ans.append(i)
  	if ans[0]%3 != 0 or ans[0]%5 != 0:
    	print("DENIED")
        exit()
    ans.pop(0)

print("APPROVED")
  

Fixed submission:
n = int(input())
q = list(map(int,input().split()))
ans = 0
count = 0
for i in q:
    if i%2 == 0:
        alm = i
        count += 1
        if alm%3 == 0 or alm%5 == 0:
            ans += 1
if ans == count:
    print("APPROVED")
else:
    print("DENIED")
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = list(map(int,input().split()))
m = sorted(h,reverse=True)
if n <= k:
  print(0)
  exit()
for i in range(k):
  m.pop(0)
print(sum(m))

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
m = sorted(h,reverse=True)
if n <= k:
  print(0)
  exit()

q = sum(m[k:n])
print(q)