/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 15ms 2.871 MiB
#2 Accepted 15ms 3.02 MiB
#3 Accepted 15ms 3.02 MiB
#4 Accepted 15ms 3.117 MiB
#5 Accepted 15ms 3.109 MiB
#6 Accepted 15ms 3.113 MiB
#7 Accepted 15ms 2.875 MiB
#8 Accepted 15ms 3.074 MiB
#9 Wrong Answer 61ms 12.27 MiB
#10 Accepted 60ms 12.109 MiB
#11 Wrong Answer 62ms 12.316 MiB

Code

N = int(input())
arr = list(map(int, input().split()))
oddCount = 0
even_count = 0
none=0
for i in range(N):
    if arr[i] % 2 != 0:
        oddCount += 1
    elif arr[i]==0:
      none+=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:42:32
Judged At
2024-11-11 03:38:14
Judged By
Score
50
Total Time
62ms
Peak Memory
12.316 MiB