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

Fixed submission:
n = int(input())
trv = [[0,0,0]]
for i in range(n):
    t,x,y = map(int,input().split())
    a = [t,x,y]
    trv.append(a)

flag = 1

for i in range(1,len(trv)):
    time = trv[i][0]-trv[i-1][0]
    dist = abs(trv[i][1]-trv[i-1][1]) + abs(trv[i][2]-trv[i-1][2])
    if time < dist:
        flag = 0
    elif time >= dist and (time-dist) % 2 == 0:
        None
    else:
        flag = 0
        break
        
if flag == 0:
    print('No')
else:
    print('Yes')

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

flag = 1
for i in range(1,len(trv)+1):
    time = trv[i][0]-trv[i-1][0]
    dist = abs(trv[i][1]-trv[i-1][1]) + abs(trv[i][2]-trv[i-1][2])
    if time < dist:
        flag = 0
        break
    elif time >= dist and (time-dist) % 2 == 0:
        None
    else:
        flag = 0
        break
        
if flag == 0:
    print('No')
else:
    print('Yes')
Problem p03469 (python)

Fixed submission:
s = list(str(input()))
 
s[3] = '8'
 
t = ''
for i in range(len(s)):
  t = t + s[i]
  
print(t)

Buggy submission (verdict: Runtime Error):
s = list(str(input()))
s[3] = 8

ss = ''
 
for i in s:
  ss = ss + i
  
print(ss)

Buggy submission (verdict: Runtime Error):
s = list(str(input()))

s[3] = 8

t = ''
for i in range(len(s)):
  t = t + s[i]
  
print(t)
Problem p03471 (python)

Fixed submission:
n, y = map(int,input().split())
s = []
for i in range(n+1):
    for j in range(n+1):
        if i * 10000 + j * 5000 + (n-i-j) * 1000 == y and n-i-j > -1:
            s.append(i)
            s.append(j)
            s.append(n-i-j)
            break
            
if s ==[]:
    print('-1 -1 -1')
else:
    print(str(s[0]) + ' ' + str(s[1]) + ' ' + str(s[2]))

Buggy submission (verdict: Runtime Error):
n, y = map(int,input().split())
s = []
for i in range(n):
    for j in range(n-i):
        if i * 10000 + j * 5000 + (n-i-j) * 1000 == y:
            s.append(i)
            s.append(j)
            s.append(k)
            break
            
if s ==[]:
    print('-1 -1 -1')
else:
    print(str(s[0]) + ' ' + str(s[1]) + ' ' + str(s[2]))
Problem p03477 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
 
if a+ b > c + d:
  print('Left')
elif a + b == c + d:
  print('Balanced')
else:
  print('Right')

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

if a+ b < c + d:
  print('Left')
elif a + b = c + d:
  print('Balanced')
else:
  print('Right')
Problem p03485 (python)

Fixed submission:
l = list(map(int,input().split()))
 
s = l[0] + l[1]
if s % 2 == 1:
    s = s+ 1
else:
    None
print(s // 2)

Buggy submission (verdict: Runtime Error):
l = list(map(int,input().split()))
 
s = l[0] + l[1]
if s % 2 = 1:
    s = s+ 1
else:
    None
print(s // 2)

Buggy submission (verdict: Runtime Error):
l = list(map(int,input().split()))
 
s = l[0] + l[1]
if s % 2 = 1:
  s = s+ 1
else:
  None
  
print(s // 2)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
 
s = a + b
if s % 2 = 1:
  s = s+ 1
  
print(s // 2)

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

s = a + b
if s % 2 = 1:
  s =s+ 1
  
print(s // 2)

Buggy submission (verdict: Runtime Error):
import math as m
a,b = map(int,input().split())

print(m.round(a + b))
Problem p03487 (python)

Fixed submission:
n = int(input())
an = list(map(int,input().split()))

anset = list(set(an))

andict = {}

for i in range(len(an)):
    if an[i] in andict:
        andict[an[i]] = andict[an[i]] + 1
    else:
        andict.update({an[i]:1})

counter = 0

for i ,j in andict.items():
    if i == j :
        None
    elif i > j:
        counter = counter + j
    elif i < j:
        counter = counter + j - i
    
        
print(counter)

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

anset = list(set(an))

andict = {}

for i in range(len(an)):
    if an[i] in andict:
        andict[an[i]] = andict[an[i]] + 1
    else:
        andict.update({an[i]:1})

counter = 0

for i ,j in andict.keys(), andict.values():
    if i == j :
        None
    elif i > j:
        counter = counter + j
    elif i < j:
        counter = counter + j - i
    
        
print(counter)
Problem p03495 (python)

Fixed submission:
n, k = map(int,input().split())
al = list(map(int,input().split()))
dics = {}
 
for i in range(n):
    if al[i] in dics:
        dics[al[i]] = dics[al[i]] + 1
    else:
        dics.update({al[i]:1})
        
counts = len(dics.values())
kesu = 0
sortv = list(sorted(list((dics.values()))))

i = counts
j = 0
while i > k:
    kesu = kesu + sortv[j]
    i = i - 1
    j = j + 1
print(kesu)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
al = list(map(int,input().split()))
dics = {}

for i in range(n):
    if al[i] in dics:
        dics[al[i]] = dics[al[i]] + 1
    else:
        dics.update({al[i]:1})
        
counts = len(dics.keys())
kesu = 0
sortv = list(sorted(dics.values()))

if len(sortv) > k:
    for i in range(n-k-1):
        kesu = kesu + sortv[i]
print(kesu)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
al = list(map(int,input().split()))
dics = {}

for i in range(n):
    if al[i] in dics:
        dics[al[i]] = dics[al[i]] + 1
    else:
        dics.update({al[i]:1})
        
counts = len(dics.values())
kesu = 0
sortv = list(sorted(dics.values()))

if len(sortv) > k:
    for i in range(n-k):
        kesu = kesu + sortv[i]
print(kesu)

Buggy submission (verdict: Runtime Error):
 n, k = map(int,input().split())
al = list(map(int,input().split()))
dics = {}

for i in range(n):
    if al[i] in dics:
        dics[al[i]] = dics[al[i]] + 1
    else:
        dics.update({al[i]:1})
        
counts = len(dics.values())
kesu = 0
sortv = list(sorted(dics.values()))

#while len(sortv) > k:
#    kesu = kesu + sortv[0]
#    sortv.remove(sortv[0])

if len(sortv) > k:
    for i in range(n-k+1):
        kesu = kesu + sortv[i]
print(kesu)

Buggy submission (verdict: Runtime Error):
 n, k = map(int,input().split())
al = list(map(int,input().split()))
dics = {}

for i in range(n):
    if al[i] in dics:
        dics[al[i]] = dics[al[i]] + 1
    else:
        dics.update({al[i]:1})
        
counts = len(dics.values())
kesu = 0
sortv = list(sorted(list((dics.values()))))

#while len(sortv) > k:
#    kesu = kesu + sortv[0]
#    sortv.remove(sortv[0])

if len(sortv) > k:
    for i in range(n-k):
        kesu = kesu + sortv[i]
print(kesu)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
al = list(map(int,input().split()))
dics = {}

for i in range(n):
    if al[i] in dics:
        dics[al[i]] = dics[al[i]] + 1
    else:
        dics.update({al[i]:1})
        
counts = len(dics.values())
kesu = 0
sortv = list(sorted(list((dics.values()))))

#while len(sortv) > k:
#    kesu = kesu + sortv[0]
#    sortv.remove(sortv[0])

if len(sortv) > k:
    for i in range(n-k):
        kesu = kesu + sortv[i]
print(kesu)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
al = list(map(int,input().split()))
dics = {}

for i in range(n):
    if al[i] in dics:
        dics[al[i]] = dics[al[i]] + 1
    else:
        dics.update({al[i]:1})
        
counts = len(dics.values())
kesu = 0
sortv = dics.values()
while len(sortv) > k:
    kesu = kesu + min(sortv)
    sortv.remove(min(sortv))
print(kesu)
Problem p03543 (python)

Fixed submission:
m = int(input())
k = []
for i in range(10):
    k.append((i )*111)

if ((m % 1000) in k) or (m % 1110 >=0 and m % 1110 < 10):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
m = int(input())
k = []
for i in range(9):
    k.append((i + 1)*111)
print(k)

if ((m % 1000) in k) or (m % 1110 =>0 and m % 1110 <= 9):
    print('Yes')
else:
    print('No')
Problem p03545 (python)

Fixed submission:
p = str(input())

q =list(str(p))
r = []

for i in range(len(q)):
    r.append(int(q[i]))

a = r[0]
b = [-r[1],r[1]]
c = [-r[2],r[2]]
d = [-r[3],r[3]]

e = []
for i in range(2):
    for j in range(2):
        for k in range(2):
            if a + b[i] + c[j] + d[k] == 7:
                e.append(a)
                e.append(b[i])
                e.append(c[j])
                e.append(d[k])

for i in range(len(e)):
    if e[i] < 0 or i == 0:
        e[i] = str(e[i])
    else:
        e[i] = '+' + str(e[i])
        
print(e[0] + e[1] + e[2] + e[3] + '=7')

Buggy submission (verdict: Runtime Error):
p = int(input())

q =list(str(p))
r = []
for i in range(len(q)):
    r.append(int(q[i]))
    
a = r[0]
b = [-r[1],r[1]]
c = [-r[2],r[2]]
d = [-r[3],r[3]]

e = []
for i in range(2):
    for j in range(2):
        for k in range(2):
            if a + b[i] + c[j] + d[k] == 7:
                e.append(a)
                e.append(b[i])
                e.append(c[j])
                e.append(d[k])
                
for i in range(len(e)):
    if e[i] < 0 or i == 0:
        e[i] = str(e[i])
    else:
        e[i] = '+' + str(e[i])
        
print(e[0] + e[1] + e[2] + e[3])
Problem p03557 (python)

Fixed submission:
N = int(input())
a = list(map(int,input().split(" ")))
b = list(map(int,input().split(" ")))
c = list(map(int,input().split(" ")))
#アルゴリズムわからないけどN log N?
a.sort()
b.sort()
c.sort()
 
#O(N)?
i,j,k = 0,0,0
ans = 0
while j < N:
  while i < N and a[i]<b[j] :
    i += 1
  while k < N and c[k]<=b[j]:
    k += 1
  ans += i * (N - k)
  j += 1
 

print(ans)

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

adic = {}
bdic = {}
cdic = {}


setabc = list(sorted(list(set(a) | set(b) | set(c))))

setdict = {}
for i in range(len(setabc)):
    setdict.update({setabc[i]:i})
    

for i in range(len(a)):
    if setdict[a[i]] in adic:
        adic[setdict[a[i]]] =  adic[setdict[a[i]]] + 1 
    else:
        adic.update({setdict[a[i]]:1})

for i in range(len(b)):
    if setdict[b[i]] in bdic:
        bdic[setdict[b[i]]] =  bdic[setdict[b[i]]] + 1 
    else:
        bdic.update({setdict[b[i]]:1})

for i in range(len(c)):
    if setdict[c[i]] in cdic:
        cdic[setdict[c[i]]] =  cdic[setdict[c[i]]] + 1 
    else:
        cdic.update({setdict[c[i]]:1})

ami = min(adic.keys())
ama = max(adic.keys())
bmi= min(bdic.keys())
bma= max(bdic.keys())
cmi= min(cdic.keys())
cma= max(cdic.keys())



        
        
summer = 0
for j in bdic.keys():
    ai = 0
    ci = 0
    for i in range(j):
        if i in adic.keys():
            ai = ai + adic[i]
    for k in range(j,cma + 1):
        if k in cdic.keys():
            ci = ci + cdic[i]
    summer = summer + bdic[j] * ai * ci       
print(summer)

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

adic = {}
bdic = {}
cdic = {}


setabc = list(sorted(list(set(a) | set(b) | set(c))))

setdict = {}
for i in range(len(setabc)):
    setdict.update({setabc[i]:i})
    

for i in range(len(a)):
    if setdict[a[i]] in adic:
        adic[setdict[a[i]]] =  adic[setdict[a[i]]] + 1 
    else:
        adic.update({setdict[a[i]]:1})

for i in range(len(b)):
    if setdict[b[i]] in bdic:
        bdic[setdict[b[i]]] =  bdic[setdict[b[i]]] + 1 
    else:
        bdic.update({setdict[b[i]]:1})

for i in range(len(c)):
    if setdict[c[i]] in cdic:
        cdic[setdict[c[i]]] =  cdic[setdict[c[i]]] + 1 
    else:
        cdic.update({setdict[c[i]]:1})

ami = min(adic.keys())
ama = max(adic.keys())
bmi= min(bdic.keys())
bma= max(bdic.keys())
cmi= min(cdic.keys())
cma= max(cdic.keys())

        
        
summer = 0
for i in range(ami,ama+1):
    for j in range(bmi,bma + 1):
        if i < j:
            for k in range(cmi,cma+1):
                if i< j< k:
                    summer = summer + adic[i] * bdic[j] * cdic[k] 
                
print(summer)
Problem p03575 (python)

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

H = [[0 for _ in range(n)] for _ in range(n) ]
edge_list = []

for _ in range(m):
    a, b = map(int,input().split())
    edge_list.append([a,b])
    H[a-1][b-1] = 1
    H[b-1][a-1] = 1
    
visited = [0 for _ in range(n)]

def dfs(node):
    visited[node] = 1
    for node_,edge_ in enumerate(H[node]):
        if edge_ == 1:
            if visited[node_] == 1:
                continue
            dfs(node_)
ans = 0
for _ in edge_list:
    H[_[0] -1][_[1] - 1] = 0
    H[_[1] -1][_[0] - 1] = 0
    
    dfs(1)
    if 0 in visited:
        ans += 1
    H[_[0] -1][_[1] - 1] = 1
    H[_[1] -1][_[0] - 1] = 1
    visited = [0 for _ in range(n)]
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
G = [[0] * N for i in range(N)]

edgeset  = []
for i in range(M):
    a,b = map(int,input().split())
    G[a-1][b-1] = 1
    G[b-1][a-1] = 1
    edgeset.append([a,b])
    
visited = None
def dfs(v):
    visited[v] = 1
    for u, e in enumerate(G[v]):
        if e == 0 or visited[u] == 1:
            continue
        dfs(u)
ans = 0

for j in edgeset:
    G[j[0] - 1][j[1] - 1]= 0
    G[j[1] - 1][j[0] - 1]= 0
    visited = [[0] * N]
    dfs(0)   
    G[j[0] - 1][j[1] - 1]= 1
    G[j[1] - 1][j[0] - 1]= 1
    if 0 in visited:
        ans+= 1
print(ans)

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

B = []
for i in range(n+1):
    onel = []
    for j in range(n+1):
        onel.append(0)
    B.append(onel)
    
visited_checklist = []

input_node = []

for i in range(n+1):
    visited_checklist.append(i)
    
for k in range(m):
    ai,bi = map(int,input().split())
    B[ai][bi] = 1
    B[bi][ai] = 1
    input_node.append([ai,bi])
    
def DFS(node):
    l[node] = 0
    for j in range(n+1):
        if X[node][j] == 1 or X[j][node] == 1 and l[j] != 0:
            l[j] = 0 
            X[node][j] == 0
            X[j][node] == 0
            DFS(j)
        if X[node][j] == 0 or X[j][node] == 0:
            continue
        if max(l) == 0:
            break
        if l[j] == 0:
            continue

    
count = 0

for i in input_node:
    X = B
    X[i[0]][i[1]] = 0
    X[i[1]][i[0]] = 0
    l = visited_checklist
    DFS(1)
    if max(l) != 0:
        count += 1
print(count)
Problem p03607 (python)

Fixed submission:
n = int(input())

nlll = {}
    
for i in range(n):
    aaa = int(input())
    if aaa in nlll:
        del nlll[aaa]
    else:
        nlll.update({aaa:1})

sums = 0
for i in nlll.values():
    sums = sums + i
print(sums)

Buggy submission (verdict: Runtime Error):
n = int(input())

nlll = {}
    
for i in range(n):
    aaa = int(input())
    if nlll in aaa:
        del aaa
    else:
        nlll.update({aaa:1})

sums = 0
for i in nlll.values():
    sums = sums + i
print(sums)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
    

b = list(set(a))

for i in b:
    if a.count(i) % 2 == 0:
        b.remove(i)
    else:
        None
        
print(len(list(b))
Problem p03609 (python)

Fixed submission:
X, t = map(int,input().split())
if X >= t:
  print(X-t)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
#include <iostream>
 
int main(void)
{
  int x,t;
  std::cin >> x >> t;
  x = std::max<int>(0,x-t);
  std::cout << x << std::endl;
  return 0;
}

Buggy submission (verdict: Runtime Error):
#include <iostream>

int main()
{
  int x,t;
  std::cin >> x >> t;
  x = std::max<int>(0,x-t);
  std::cout << x << std::endl;
  return 0;
}
Problem p03611 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
aa = []
amax = max(a) + 100


for i in range(amax + 1):
    aa.append(0)

for i in range(len(a)):
    aa[a[i]] = aa[a[i]] + 1
    
kouho = 1    
for j in range(len(aa) - 2):
    if kouho < aa[j] + aa[j + 1] + aa[j + 2]:
        kouho = aa[j] + aa[j + 1] + aa[j + 2]

print(kouho)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
dics = {}
for i in range(len(n)):
    if a[i] in dics:
        dics[a[i]] = dics[a[i]]  + 1
    else:
        dics.update({a[i]:1})
    
#dics min max
dicsmin = min(list(dics.keys()))
dicsmax = max(list(dics.keys()))

counter = []
for i in range(dicsmin,dicsmax + 1):
    xcount = 0
    x = i
    #beam search x
    for j in range(len(a)):
        if a[j] == x or x-1 or x + 1:
            xcount = xcount + 1
    counter.append(xcount)
    
print(max(xcount))
Problem p03625 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Adict = {}
for i in A:
    if i in Adict:
        Adict[i]=Adict[i]+1
    else:
        Adict.update({i:1})
B = [0, 0]
for i in Adict.keys():
    if Adict[i] >= 2:
        B.append(i)
    if Adict[i] >= 4:
        B.append(i)
B.sort()
print(B[-1]*B[-2])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Adict = []
for i in A:
    if i in Adict:
        Adict[i]=Adict[i]+1
    else:
        Adict.update({i:1})
B = [0, 0]
for i in Adict.keys():
    if Adict[i] >= 2:
        B.append(i)
    if Adict[i] >= 4:
        B.append(i)
B.sort()
print(B[-1]*B[-2])

Buggy submission (verdict: Runtime Error):

N = int(input())
A = list(map(int, input().split()))
Adict = []
for i in A:
  if i in Adict:
    Adict[i]=Adict[i]+1
  else:
    Adict.update({i:1})
B = [0, 0]
for i in Adict.keys():
    if Adict[i] >= 2:
        B.append(i)
    if Adict[i] >= 4:
        B.append(i)
B.sort()
print(B[-1]*B[-2])

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

a_sort = list(reversed(list(sorted(a))))
amax = max(a_sort)

if a_sort.count(amax) >3:
    print(amax ** 2)
    
else:
    one = 0
    two = 0
    for i in a_sort:
        if a_sort.count(i) > 1 and one = 0 and two = 0:
            one = i
        elif a_sort.count(i) > 1 and one > 0 and two = 0:
            two = i
        else:
            break
    print(one*two)

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

a_sort = list(sorted(a))
ad = {}
for i in range(len(a_sort)):
    if ad in a_sort[i]:
        ad[a_sort[i]] = ad[a_sort[i]] + 1
    else:
        ad.update(a_sort[i]:1)
ad2 = ad
for key in ad.keys():
    if ad[key] < 2:
        del ad2[key]

amax = max(ad2.keys())
b = ad2
while amax in b:
    b.remove(amax)
bmax = max(b)

if ad2[amax] > 3:
    print(amax*amax)
else:
    print(amax*bmax)
Problem p03633 (python)

Fixed submission:
n = int(input())
tt = []
for i in range(n):
    tt.append(int(input()))
    
ss = 1

for i in tt:
    p = []
    p.append(int(ss))
    p.append(int(i))
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = int(s[0])
        q[1] = int(s[1])

        
    ss = int(ss * i) // q[0]

print(ss)

Buggy submission (verdict: Runtime Error):
n = int(input())
tt = []
for i in range(n):
    tt.append(int(input()))
    
ss = int(1)

for i in tt:
    p = []
    p.append(int(ss))
    p.append(int(i))
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = int(s[0])
        q[1] = int(s[1])

        
    ss = int(ss * i / q[0])

print(ss)

Buggy submission (verdict: Runtime Error):
n = int(input())
tt = []
for i in range(n):
    tt.append(int(input()))
    
ss = int(1)

for i in tt:
    p = []
    p.append(int(ss))
    p.append(int(i))
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = int(s[0])
        q[1] = int(s[1])

        
    ss = int(ss * i / q[0])

print(int(ss))

Buggy submission (verdict: Runtime Error):
n = int(input())
tt = []
for i in range(n):
    tt.append(int(input()))
    
ss = int(1)

for i in tt:
    p = []
    p.append(ss)
    p.append(i)
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = s[0]
        q[1] = s[1]

        
    ss = int(ss * i / q[0])

print(int(ss))

Buggy submission (verdict: Runtime Error):
n = int(input())
tt = []
for i in range(n):
    tt.append(int(input()))
    
ss = int(1)

for i in tt:
    p = []
    p.append(ss)
    p.append(i)
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = s[0]
        q[1] = s[1]
        print(q)
        
    ss = int(ss * i / q[0])

print(int(ss))
Problem p03637 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))

zero = 0
two = 0
odd = 0

for i in range(len(a)):
    if a[i] % 4 == 1 or a[i] % 4 == 3:
        odd = odd + 1
    elif a[i] % 4 == 0:
        zero = zero + 1
    else:
        two = two + 1
        
if zero >= odd -1 and two == 0:
    print('Yes')
elif zero >= odd:
    print('Yes')
else:
    print('No')

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

zero = 0
two = 0
odd = 0

for i in range(len(a)):
    if a[i] % 4 == 1 or a[i] % 4 == 3:
        odd = odd + 1
    elif a[i] % 4 == 0:
        zero = zero + 1
    else:
        two = two + 1
        
if zero >= odd -1 and two =n = int(input())
a = list(map(int,input().split()))

zero = 0
two = 0
odd = 0

for i in range(len(a)):
    if a[i] % 4 == 1 or a[i] % 4 == 3:
        odd = odd + 1
    elif a[i] % 4 == 0:
        zero = zero + 1
    else:
        two = two + 1
        
if zero >= odd -1 and two = 0:
    print('Yes')
elif zero >= odd:
    print('Yes')
else:
    print('No')= 0:
    print('Yes')
elif zero >= odd:
    print('Yes')
else:
    print('No')

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

zero = 0
two = 0
odd = 0

for i in range(len(a)):
    if a[i] % 4 == 1 or a[i] % 4 == 3:
        odd = odd + 1
    elif a[i] % 4 == 0:
        zero = zero + 1
    else:
        two = two + 1
        
if zero >= odd -1 and two = 0:
    print('Yes')
elif zero >= odd:
    print('Yes')
else:
    print('No')