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]);
}
int sub_arrays = 0;
int sum = 0;
for (int i = 0; i < N; i++) {
sum += arr[i];
if (sum % 2 != 0 || (i == N - 1 && sum % 2 == 0)) {
sub_arrays++;
sum = 0;
}
}
printf("%d\n", sub_arrays);
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:32:17
- Judged At
- 2024-11-11 03:37:34
- Judged By
- Score
- 15
- Total Time
- 1ms
- Peak Memory
- 328.0 KiB