Wrong Answer
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