Wrong Answer
Code
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int arr[n];
for (int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
if (arr[0] % 2 != 0) {
printf("-1\n");
} else {
int count = 1;
for (int i = 1; i < n; i++) {
if (arr[i] % 2 != 0 && arr[i - 1] % 2 != 0) {
continue;
}
count++;
}
printf("%d\n", count);
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1042 Array partition
- Contest
- TLE_Headquarters - round #1
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2024-03-27 17:55:34
- Judged At
- 2024-11-11 03:37:22
- Judged By
- Score
- 25
- Total Time
- 0ms
- Peak Memory
- 516.0 KiB