去除奇数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

问题陈述

给定序列 a1,a2,,ana_1, a_2, \ldots, a_n ,求从序列中删除元素的最小个数,使得删除后每 22 个连续元素之和为偶数。

输入格式

第一行都包含一个整数 nn ( 3n1063 \le n \le 10^6 )。 第二行包含 nn 个整数 a1,a2,,ana_1, a_2,\dots,a_n1ai1091\leq a_i\leq10^9 )。( 1ai1091\leq a_i\leq10^9 ) 表示序列元素。

输出格式

打印一个整数表示从序列中删除的最小元素数,以使每个 22 连续元素的和为偶数。

样例1

input

5
2 4 3 6 8

output

1

样例2

input

6
3 5 9 7 1 3

output

0

限制与约定

对于 30%30\% 的数据,nn \le 100100

对于 60%60\% 的数据,n n \le 104 10^4

对于 100%100\% 的数据,nn \le 10610^6

  • 时间限制: 1s1 s
  • 空间限制: 512MB512 MB

柳泉中学7.7日下午

Not Attended
Status
Done
Rule
IOI
Problem
17
Start at
2025-7-7 14:00
End at
2025-7-7 17:00
Duration
3 hour(s)
Host
Partic.
23