/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 15ms 2.961 MiB
#2 Accepted 15ms 3.078 MiB
#3 Accepted 15ms 2.984 MiB
#4 Accepted 15ms 3.113 MiB
#5 Accepted 15ms 3.102 MiB
#6 Accepted 15ms 3.109 MiB
#7 Accepted 15ms 3.102 MiB
#8 Accepted 15ms 3.07 MiB
#9 Wrong Answer 58ms 12.113 MiB
#10 Accepted 58ms 12.117 MiB
#11 Wrong Answer 59ms 12.266 MiB

Code

N = int(input())
arr = list(map(int, input().split()))
oddCount = 0
even_count = 0
for i in range(N):
    if arr[i] % 2 != 0:
        oddCount += 1
    else:
        even_count += 1
if oddCount % 2 != 0:
    print(-1)
else:
    print(oddCount // 2 + even_count)

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 16:30:24
Judged At
2024-11-11 03:38:37
Judged By
Score
50
Total Time
59ms
Peak Memory
12.266 MiB