TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Dolphin is planning to generate a small amount of a certain chemical substance C.   In order to generate the substance C, he must prepare a solution which is a mixture of two substances A and B in the ratio of M_a:M_b.   He does not have any stock of chemicals, however, so he will purchase some chemicals at a local pharmacy.   The pharmacy sells N kinds of chemicals. For each kind of chemical, there is exactly one package of that chemical in stock.   The package of chemical i contains a_i grams of the substance A and b_i grams of the substance B, and is sold for c_i yen (the currency of Japan).   Dolphin will purchase some of these packages. For some reason, he must use all contents of the purchased packages to generate the substance C.   Find the minimum amount of money required to generate the substance C.   If it is not possible to generate the substance C by purchasing any combination of packages at the pharmacy, report that fact.

Submission attempts (in order):
def main():
    N, Ma, Mb = map(int, input().split())
    yakuhin = []
    sa = 0
    sb = 0
    for i in range(N):
        yakuhin.append(list(map(int, input().split())))
        sa += yakuhin[i][0]
        sb += yakuhin[i][1]
    
    INF = 10**15
    DP = [[[INF for _ in range(sb+1)] for _ in range(sa+1)] for _ in range(N+1)]
    DP[0][0][0] = 0
    
    for i in range(N):
        for j in range(sa+1):
            for k in range(sb+1):
                if(j >= yakuhin[i][0] and k >= yakuhin[i][1]):
                    DP[i+1][j][k] = min(DP[i][j-yakuhin[i][0]][k-yakuhin[i][1]], DP[i][j-yakuhin[i][0]][k-yakuhin[i][1]]+yakuhin[i][2])
                else:
                    DP[i+1][j][k] = min(DP[i+1][j][k], DP[i][j][k])
        
    ans = INF
    for i in range(1, N):
        for j in range(1, sa+1):
            for k in range(1, sb+1):
                if(j*Mb == k*Ma):
                    ans = min(ans, DP[i][j][k])    
        
    print(ans if ans != INF else -1)
    
main()

def main():
    N, Ma, Mb = map(int, input().split())
    yakuhin = []
    for i in range(N):
        yakuhin.append(list(map(int, input().split())))
    
    INF = 10**15
    DP = [[[INF for _ in range(401)] for _ in range(401)] for _ in range(N+1)]
    DP[0][0][0] = 0
    
    for i in range(N):
        for j in range(401):
            for k in range(401):
                if(DP[i][j][k] != INF):
                    DP[i+1][j][k] = min(DP[i+1][j][k], DP[i][j][k])
                    DP[i+1][j+yakuhin[i][0]][k+yakuhin[i][1]] = min(DP[i+1][j+yakuhin[i][0]][k+yakuhin[i][1]], DP[i][j][k]+yakuhin[i][2])
    
    ans = INF
    for i in range(1, N+1):
        for j in range(1, 401):
            for k in range(1, 401):
                if(j*Mb == k*Ma):
                    ans = min(ans, DP[i][j][k])    
        
    print(ans if ans != INF else -1)
    
main()

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
import sys
sys.stdin.readline()
count = 0
a_list = list(map(int, sys.stdin.readline().split()))
for a in x_list:
  count += a%2

print("YES") if count%2==0 else print("NO")

import sys
input_ = sys.stdin.readline
input_()
x_list = list(map(int, input_().split()))
for x in x_list:
  if x%2==0:
    a += 1

if a%2==0:
  print("YES")
else:
  print("NO")

import sys
input()
count = 0
a_list = list(map(int, input().split()))
for a in a_list:
  count += a%2

print("YES") if count%2==0 else print("NO")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
a = list(map(int,input().split()))
s = 0
for i in a:
    if i % 2 == 1:
        s += 1
if s % 2 == 0:
    print("Yes")
else:
    print("No")

N = int(input())
a = list(map(int,input().split()))
s = 0
for i in a:
    if i % 2 == 1:
        s += 1
if s % 2 == 0:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N=int(input())
A=list(map(int,input().split()))
B=[x for x in A if x%2==1]
print('Yes' if len(B)%2==0 else 'No')

N=int(input())
A=list(map(int,input().split()))
B=[x for x in A if x%2==1]
print('YES' if len(B)%2==0 else 'NO')

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n=int(input())
a=list(map(int, input().split()))
a=[i%2 for i in a]
b=a.count(1)
an=a.count(0)+b//2
if an%2+b%2==1:print('YES')
else:print('NO')

n=int(input())
a=list(map(int, input().split()))
a=[i%2 for i in a]
b=a.count(1)
anb,b=a.count(0)+b//2,b+b//2
if an%2+b%2==1:print('YES')
else:print('NO')

n=int(input())
a=list(map(int, input().split()))
a=[i%2 for i in a]
b=a.count(1)
anb,b=a.count(0)+b//2,b+b//2
if an%2+b%2==1:print('YES')
else:print('NO')

n=int(input())
a=list(map(int, input().split()))
a=[i for i in a if i%2==1]
if len(a)%2==1:print('NO')
else:print('YES')

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
odd = len(list(filter(lambda x: x % 2 == 1, A)))
if odd % 2 == 0:
    print("Yes")
else:
    print("No")
    

N = input()
A = list(map(int, input().split()))





odd = len(list(filter(lambda x: x % 2 == 1, A)))
print("YES" if odd % 2 == 0 else "NO")


Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
numInput = int(input())

amount = numInput
numOdd = int(numInput / 2) + (numInput % 2)
numEven = int(numInput / 2)

while True:

    if amount >= 3:
        if numOdd >= 2:
            numOdd -= 2
            numEven += 1
            amount -= 1
        else:
            numEven -= 1
            amount -= 1
    else:
        if amount == 2 and numOdd == 1 and numEven == 1:
            break
        if amount < 2:
            break

if amount == 1:
    print('YES')
else:
    print('NO')


numInput = int(input())

amount = numInput
numOdd = int(numInput / 2) + (numInput % 2)
numEven 0 int(numInput / 2)

while True:

    if amount >= 2:
        if numOdd >= 2:
            numOdd -= 2
            numEven += 1
            amount -= 1
        else:
            numEven -= 1
            amount -= 1
    else:
        break

if amount == 1:
    print('YES')
else:
    print('NO')


numInput = int(input())

numSequence = list(map(int, input().split(' ')))

numOdd = 0
for i in range(0, len(numSequence)):
    if numSequence[i] % 2 == 1:
        numOdd += 1
        
if numOdd % 2 == 0:
    print('YES')
else:
    print('NO')


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
print("Yes" if sum(A)%2==0 else "No")

N = int(input())
A = list(map(int,input().split()))
print("YES" if sum(A)%2==0 else "NO")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
e=0
o=0
for i in range(n):
    if a[i]%2==0:
        e+=1
    else:
        o+=1
if o>e:
    if o%2!=0:
        print("No")
    else:
        print("Yes")
else:
    print("Yes")

n = int(input())
a = list(map(int, input().split()))
e=0
o=0
for i in range(n):
    if a[i]%2==0:
        e+=1
    else:
        o+=1
if n%2==0 and o%2==0:
    print("YES")
elif n%2!=0 and o%2==0:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
def even(num):
    if num & 1:
        return('uneven')
    else:
        return('even')

N = int(input())
A = list(map(int, input().split()))

n = 0
for a in A:
    if even(a) == 'uneven':
        n += 1

if even(n) =a= 'even':
    print('YES')
else:
    print('NO')


def even(num):
    if num & 1:
        return('uneven')
    else:
        return('even')

N = int(input())
A = list(map(int, input().split()))

n = 0
for a in A:
    if even(a) == 'uneven':
        n += 1

if even(n) == 'even':
    print('YES')
else:
    print('NO')


Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
a, b, c = sorted(list(map(int, input().split())))

count  = (b - a) // 2
count += 2 if (a + count * 2) != b else 0
count += c - b
print(count)


input()

print("NO" if sum(map(int, input().split())) % 2 else "YES")


Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n=int(input())
s=input().split()
i=0
count=0
while i<0:
  if s[i]%2!=0:
    count+=1
if count%2==0:
  print("Yes")
else:
  print("No")

s=input().split()
i=0
count=0
while i<n:
  if int(s[i])%2!=0:
    count+=1
  i+=1
if count%2==0:
  print("Yes")
else:
  print("No")

n=int(input())
s=input().split()
i=0
count=0
while i<n:
  if int(s[i])%2!=0:
    count+=1
  i+=1
if count%2==0:
  print("Yes")
else:
  print("No")

n=int(input())
s=input().split()
i=0
count=0
while i<n:
  if int(s[i])%2!=0:
    count+=1
  i+=1
if count%2==0:
  print("YES")
else:
  print("NO")

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = [int(i) for i in input().split()]

odd = 0 
even = 0 

for i in range(N):
    if A[i]%2 == 0:
        even += 1
    else:
        odd += 1

if abs(odd - even)%2 == 0:
    print("YES")
elif odd > even:
    print("NO")
else:
    print("YES")

N = int(input())
A = [int(i) for i in input().split()]

odd = 0
for i in range(N):
    if A[i]%2 != 0:
        odd += 1
    
if odd%2 != 0:
    print("NO")
else:
    print("YES")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))
even_cnt=0
odd_cnt=0
for i in a:
    if i%2==0:
        even_cnt+=1
    else:
        odd_cnt+=1
if 1<=odd_cnt:
    even_cnt+=odd_cnt//2　
    odd_cnt=odd_cnt%2 
    even_cnt=even_cnt%2
    if even_cnt==1 and odd_cnt==1:
        print("NO")
    else:
        print("YES")
else:
    print("YES")





n=int(input())
a=list(map(int,input().split()))
ood_cnt=0
for i in range(n):
    if a[i]%2==1:
        ood_cnt+=1
if ood_cnt%2==0:
    print("YES")
else:
    print("NO")


Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n = int(input())
nums = list(map(int, input().split()))

print('NO' if (sum(map(lambda x:x%2, nums)))%2 else 'YESs')


n = int(input())
nums = list(map(int, input().split()))

print('NO' if (sum(map(lambda x:x%2, nums)))%2 else 'YES')


Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n=int(input())
arr=list(map(int,input().split()))
count=0
for i in range(n):
  if arr[0]%2==1:
    count+=1
if count%2==1:
  print('NO')
else:
  print('YES')

n=int(input())
arr=list(map(int,input().split()))
count=0
for i in range(n):
  if arr[i]%2==1:
    count+=1
if count%2==1:
  print('NO')
else:
  print('YES')

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
A = list(map(int,input().split()))
AA = sum([i%2 for i in A])
if N == 1:
    print('YES')
    exit()
if AA % 2 == 1:
    print('NO')
    exit()
print('YES') 


N = int(input())
A = list(map(int,input().split()))
AA = sum([i%2 for i in A])
if N == 1:
    print('YES')
    exit()
if AA % 2 == 1:
    print('NO')
    exit()
print('YES') 


Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n=int(input())
i = list(map(int, input().split()))
s=0
for j in range(len(i)):
  if i[j]%2==1:
    s+=1
if s%2==0:
  print("Yes")
else:
  print("No")

n=int(input())
i = list(map(int, input().split()))
s=0
for j in range(n):
  if i[j]%2==1:
    s+=1
if s%2==0:
  print("YES")
else:
  print("NO")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
_ = input()
As = [int(x) for x in input().split()]
even_pair_count = 0
odd_pair_count = 0
even_pair = []
odd_pair = []
for a in As:
    if a%2 == 0:
        even_pair.append(1)    
        if len(even_pair) == 2:
            even_pair = []
            even_pair_count += 1
    else:
        odd_pair.append(1)
        if len(odd_pair) == 2:
            odd_pair = []
            odd_pair_count += 1


pair_num = even_pair_count + odd_pair_count
rest_num = len(even_pair) + len(odd_pair)

# print(rest_num)
elif rest_num == 2:
    print("NO")
if pair_num == 1:
    print("YES")
elif (pair_num+rest_num) % 2 == 0:
    print("YES")
else:
    print("NO")

_ = input()
As = [int(x) for x in input().split()]
even_pair_count = 0
odd_pair_count = 0
even_pair = []
odd_pair = []
for a in As:
    if a%2 == 0:
        even_pair.append(1)    
        if len(even_pair) == 2:
            even_pair = []
            even_pair_count += 1
    else:
        odd_pair.append(1)
        if len(odd_pair) == 2:
            odd_pair = []
            odd_pair_count += 1

pair_num = even_pair_count + odd_pair_count
rest_num = len(even_pair) + len(odd_pair)
if (pair_num+rest_num) % 2 == 0:
    print("Yes")
else:
    print("No")

_ = input()
As = [int(x) for x in input().split()]
if sum(As)%2 == 0:
    print("YES")
else:
    print("NO")

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
print(sum([1 if i % 2 == 1 else 0 for i in list(map(int, input().split(' ')))]))

print(['NO', 'YES'][sum([1 if i % 2 == 1 else 0 for i in [int(input()) % 1] + list(map(int, input().split(' ')))]) % 2])

print(sum([1 if i % 2 == 1 else 0 for i in [int(input()) % 1] + list(map(int, input().split(' ')))]))

[print(['YES','NO'][len(list(filter(lambda x:x%2,map(int,input().split(' ')))))%2]) for _ in [input()]]

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = [int(i) for i in input().split()]

c = 0
for a in A:
    if a % 2 = 1:
        c += 1
if c % 2 == 0:
    print('YES')
else:
    print('NO')


N = int(input())
A = [int(i) for i in input().split()]

c = 0
for a in A:
    if a % 2 == 1:
        c += 1
if c % 2 == 0:
    print('YES')
else:
    print('NO')


Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n = int(input())
l = list(map(int,input().split()))
m = [i%2 for i in l]
print("YNeos"[l.count(1)%2==0::2])

n = int(input())
l = list(map(int,input().split()))
m = [i%2 for i in l]
print("YNEOS"[m.count(1)%2==1::2])

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n,*a=map(int,open(0).read().split());print("YNeos"[sum(map(lambda x:x%2, a))%2::2])

n,*a=map(int,open(0).read().split());print("YNEOS"[sum(map(lambda x:x%2, a))%2::2])

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n = int(input())
L = list(map(int,input().split()))
cnt = 0
for i in range(n):
  if L[i]%2 == 1:
    cnt += 1
if cnt%2 == 1:
  print("YES")
else:
  print("NO")

n = int(input())
L = list(map(int,input().split()))
cnt = 0
for i in range(n):
  if L[i]%2 == 1:
    cnt += 1
if cnt%2 == 1:
  print("NO")
else:
  print("YES")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n = int(input().strip())
a = [int(x) for x in input().strip().split()]
flg = [-1 for i in range(n)]
b = []
l = [[] for i in range(n)]
for i in range(n - 1):
  b.append([int(x) - 1 for x in input().strip().split()])
for x in b:
  l[x[0]].append(x[1])
  l[x[1]].append(x[0])
 
while True:
  minimum = a[0]
  idx = []
  for i, x in enumerate(a):
    if flg[i] != -1 or x > minimum:
      continue
    if x < minimum:
      minimum = x
      idx =[i]
    else:
      idx.append(i)
  while True:
    w = []
    for i in idx:
      flg[i] = 0
      for x in l[i]:
        if flg[x] == -1 and a[x] != a[i]:
          flg[x] = 1
          w.append(x)
    idx = []
    for i in w:
      for x in l[i]:
        if flg[x] == -1:
          flg[x] = 0
          for y in l[x]:
            if flg[y] == -1 and a[x] > a[y]:
              flg[x] = -1
              break
          if flg[x] == 0:
            idx.append(x)
    if len(idx) == 0:
      break
  if -1 not in flg:
    break

sep = ''
s = ''
for i, x in enumerate(flg):
  if x == 1:
    s += sep + str(i + 1)
    sep = ' '

print(s)


input()
i = [int(x) % 2 for x in input().strip().split()]
if sum(i) % 2 == 0:
  print('YES')
else:
  print('NO')

Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
odd = [a for a in A if a%2]

if odd%2:
  print('NO')
else:
  print('YES')

N = int(input())
A = list(map(int, input().split()))
odd = [a for a in A if a%2]

if len(odd)%2:
  print('NO')
else:
  print('YES')

Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n = int(input())
arg_list = int(input())

k = 0
for item in arg_list:
    if item % 2 == 1 :
        k +=1
if k == 1:
    print('YES')
else:
    print('NO')
        

n = int(input())
a = map(int, input().split())
count = 0
for i in a:
    if i % 2 == 1:
        count += 1
print("YES" if count % 2 == 0 else "NO")


Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n=int(input())
a=[int(i) for i in input().split()]
g=[]
k=[]
for i in a:
    if i%2==0:
        g+=[i]
        g=[sum(g)]
    else:
        k+=[i]
        if len(k)%2==0:
            g+=[sum(k)]
            k=[]
    print(g,k)
print('YES'if g==[] or k==[] else 'NO')

n=int(input())
a=[int(i) for i in input().split()]
g=[]
k=[]
for i in a:
    if i%2==0:
        g+=[i]
        g=[sum(g)]
    else:
        k+=[i]
        if len(k)%2==0:
            g+=[sum(k)]
            k=[]

print('YES'if g==[] or k==[] else 'NO')

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
input()
a = list(map(int, input().split()))
l = len(filter(lambda x : x & 1, a))
if l & 1:
  print("NO")
else:
  print("YES")

input()
a = list(map(int, input().split()))
l = len(list(filter(lambda x : x & 1, a)))
if l & 1:
  print("NO")
else:
  print("YES")

Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
import numpy as np

N = int(input())
a = input().split(" ")
A = [int(i) for i in a]

k = [1 if A[i]%2==1 else 0 for i in range(N)]

if sum(k)%2 == 0:
    print("Yes")
else:
    print("No")

import numpy as np

N = int(input())
a = input().split(" ")
A = [int(i) for i in a]
print(A)
k = [1 if A[i]%2==1 else 0 for i in range(N)]

if sum(k)%2 == 0:
    print("YES")
else:
    print("NO")

import numpy as np

N = int(input())
a = input().split(" ")
A = [int(i) for i in a]

k = [1 if A[i]%2==1 else 0 for i in range(N)]

if sum(k)%2 == 0:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))

even_count = 0
odd_count = 0
for a in A:
    if a % 2 == 0:
        even_count += 1
    else:
        odd_count += 1

if odd_count % 2 == 1:
    print("No")
else:
    print("Yes")


N = int(input())
A = list(map(int, input().split()))

odd_count = 0
for a in A:
    if a % 2 == 1:
        odd_count += 1

if odd_count % 2 == 0:
    print("Yes")
else:
    print("No")


N = int(input())
A = list(map(int, input().split()))

even_count = 0
odd_count = 0
for a in A:
    if a % 2 == 0:
        even_count += 1
    else:
        odd_count += 1

if odd_count % 2 == 1:
    if even_count == 0 and odd_count == 1:
        print("Yes")
        exit()
    print("No")
else:
    print("Yes")

N = int(input())
A = list(map(int, input().split()))

odd = 0

for a in A:
    if a % 2 == 1:
        odd += 1

if odd % 2 == 1:
    print("NO")
else:
    print("YES")


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N=int(input())
A=list(map(int,input().split()))
od=0
for i in range(N):
    if A[i]%2==1:
        od+=1
print(od)
if od%2==0:
    print("YES")
else:
    print("NO")

N=int(input())
A=list(map(int,input().split()))
od=0
for i in range(N):
    if A[i]%2==1:
        od+=1
if od%2==0:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))

cnt=0
for i in a:
  if i%2=1:
    cnt+=1
    
if cnt%2==1:
  print('NO')
  
else:
  print('YES')

n=int(input())
a=list(map(int,input().split()))
a=[i if i%2==1 else None  for i in a]
if a.count()%2==1:
  print('NO')
else:
  print('YES')

n=int(input())
x=list(map(int,input().split()))
a=[]
for i in x:
  if i%2==1:
      a+=[i]
if len(a)%2==1:
  print('NO')
else:
  print('YES')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split(" ")))
even = []
odd = []
for i in a:
    if i % 2 == 0:
        even.append(i)
    else:
        odd.append(i)

ans = "Yes"
if len(odd) % 2 == 1:
    ans = "No"
print(ans)

n = int(input())
a = list(map(int, input().split(" ")))
even = []
odd = []
for i in a:
    if i % 2 == 0:
        even.append(i)
    else:
        odd.append(i)

ans = "YES"
if len(odd) % 2 == 1:
    ans = "NO"
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))

odd = len(list(filter(lambda x: x % 2 != 0, A)))
even = N - odd

ans = "YES"


if odd == 1 and even == 0:
    odd = odd
elif odd % 2 == 1:
    ans = "NO"
else:
    even += odd//2
    while True:
        if even == 1:
        if even % 2 == 1:
            ans = "NO"
            break
        even //= 2
print(ans)


N = int(input())
A = list(map(int, input().split()))

odd = len(list(filter(lambda x: x % 2 != 0, A)))
even = N - odd

ans = "YES"


if odd == 1 and even == 0:
    odd = odd
elif odd % 2 == 1:
    ans = "NO"
print(ans)


Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    even = 0
    odd = 0
    for aa in a:
        if aa%2 == 0:
            even += 1
        else:
            odd += 1
    if odd % 2 == 1:
        print('No')
        return
    print('Yes')


if __name__ == '__main__':
    main()

def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    even = 0
    odd = 0
    for aa in a:
        if aa%2 == 0:
            even += 1
        else:
            odd += 1
    if odd % 2 == 1:
        print('NO')
        return
    print('YES')


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
import sys

n = list(map(int, next(sys.stdin).split()))

if len(ns) == 1:
    print('YES')
    exit()

if sum(1 for n in ns if n % 2 == 1) % 2 == 0:
    print('YES')
else:
    print('NO')


import sys

if sum(for n in map(int, next(sys.stdin).split()) if n % 2 == 1) % 2 == 0:
    print('YES')
else:
    print('NO')


import sys

if sum(1 for n in map(int, next(sys.stdin).split()) if n % 2 == 1) % 2 == 0:
    print('YES')
else:
    print('NO')


import sys

next(sys.stdin)
ns = list(map(int, next(sys.stdin).split()))

if len(ns) == 1:
    print('YES')
    exit()

if sum(1 for n in ns if n % 2 == 1) % 2 == 0:
    print('YES')
else:
    print('NO')


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
num_ints = int(input())
sum_ints = sum([int(i) for i in input().split()])

if sum % 2 == 0:
    print("YES")
else:
    print("NO")


num_ints = int(input())
sum_ints = sum([int(i) for i in input().split()])

if sum_ints % 2 == 0:
    print("YES")
else:
    print("NO")


Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
P = list(map(int, input().split()))
x = 0
for i in range(N):
    if P[i]%2==1:
        x+=1
if x%2==0:
    print("Yes")
else:
    print("No")


N = int(input())
P = list(map(int, input().split()))
x = 0
for i in range(N):
    if P[i]%2==1:
        x+=1
if x%2==0:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
input()
print("YNEOS"[sum(map(int,input()))%2::2])

input()
print("YNEOS"[sum(map(int,input().split()))%2::2])

Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = [int(i)%2 for i in input().split()]

p = A.count(1)
q = A.count(0)

if p%2 != 0:
    print('NO')
else:
    if p/2+q != 1:
        print('NO')
    else:
        print('YES')


N = int(input())
A = [int(i)%2 for i in input().split()]

p = A.count(1)
q = A.count(0)

if p%2 != 0:
    print('NO')
else:
    if N == 1:
        print('NO')
    else:
        print('YES')


Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = map(int, input().split(" "))

oe = [a%2 for a in A]
if sum(oe)%2 == 0:
    print("Yes")
else:
    print("No")

N = int(input())
A = map(int, input().split(" "))

oe = [a%2 for a in A]
if sum(oe)%2 == 0:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
from sys import stdin
data = [int(x) for x in stdin.readline().rstrip().split()]
cnt = 0
for i in data:
    if i % 2 != 0:
        cnt += 1
if cnt % 2 == 0:
    print("YES")
else:
    print("NO")

from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]
cnt = 0
for i in data:
    if i % 2 != 0:
        cnt += 1
if cnt % 2 == 0:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
odd_num = 0
for i in range(n):
  if a[i] % 2 == 1:
    odd_num += 1
if odd_num % 2 == 0:
  print('Yes')
else:
  print('No')

n = int(input())
a = list(map(int, input().split()))
odd_num = 0
for i in range(n):
  if a[i] % 2 == 1:
    odd_num += 1
if odd_num % 2 == 0:
  print('YES')
else:
  print('NO')


Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
Odds = list(filter(lambda x:x%2 == 1,A))
Odds_num = len(Odds)
if Odds_num % 2 == 1:
    print("No")
else:
    print("Yes")

N = int(input())
A = list(map(int,input().split()))
Odds = list(filter(lambda x:x%2 == 1,A))
Odds_num = len(Odds)
if Odds_num % 2 == 1:
    print("NO")
else:
    print("YES")

Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
N = int(input())
A = [int(n) for n in input().split()]

cnt = 0
for in range(N):
    if A[i] % 2 == 1:
        cnt += 1

if cnt % 2 == 0:
    print ('YES')
else:
    print('NO')


N = int(input())
A = [int(n) for n in input().split()]

cnt = 0
for i in range(N):
    if A[i] % 2 == 1:
        cnt += 1

if cnt % 2 == 0:
    print ('YES')
else:
    print('NO')


Verdicts: Runtime Error

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    count = 0

    for i in range(n):
        if a[i] % 2 == 1:
            count += 1

    if count % 2 == 1:
        print('No')
    else:
        print('Yes')


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    odd_count = 0
    for aa in a:
        if aa % 2 == 1:
            odd_count += 1

    if odd_count % 2 == 1:
        print('NO')
    else:
        print('YES')


Verdicts: Wrong Answer

Accepted
Problem: There are N integers written on a blackboard. The i-th integer is A_i.  Takahashi will repeatedly perform the following operation on these numbers:    * Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.   * Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.  Determine whether it is possible to have only one integer on the blackboard.

Submission attempts (in order):
a=int(input())
li = list(map(int,input().split()))

ans = 'No'

even = []
odd = []

for i in li:
  if i % 2 == 0:
    even.append(i)
  else:
    odd.append(i)

if len(odd) % 2 == 0:
  ans = 'Yes'
  
print(ans)

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

ans = 'NO'

even = []
odd = []

for i in li:
  if i % 2 == 0:
    even.append(i)
  else:
    odd.append(i)

if len(odd) % 2 == 0:
  ans = 'YES'
  
print(ans)

Verdicts: Wrong Answer

Accepted