/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 15ms 3.125 MiB
#2 Accepted 15ms 3.105 MiB
#3 Accepted 15ms 3.102 MiB
#4 Accepted 15ms 2.957 MiB
#5 Accepted 15ms 2.898 MiB
#6 Accepted 15ms 2.891 MiB
#7 Accepted 16ms 2.922 MiB
#8 Accepted 15ms 2.898 MiB
#9 Wrong Answer 76ms 16.07 MiB
#10 Accepted 57ms 12.254 MiB
#11 Wrong Answer 79ms 16.125 MiB

Code

n = int(input())
x = list(map(int, input().split()))
count = 0
odd = 0
new = []
for i in range(n):
    if x[i] % 2 != 0:
        odd += 1
if odd % 2 != 0:
    print(-1)
else:
    z = set(x)
    for i in z:
        if i % 2 == 0:
            count += 1
    print(count+(odd//2))

Information

Submit By
Type
Submission
Problem
P1042 Array partition
Contest
TLE_Headquarters - round #1
Language
Python 3 (Python 3.12.3)
Submit At
2024-03-27 17:22:22
Judged At
2024-11-11 03:37:36
Judged By
Score
50
Total Time
79ms
Peak Memory
16.125 MiB