zoj 1622

//2588080 	2011-07-20 18:07:44 	Accepted 	1622 	C 	0 	160 	ylwh!
#include <stdio.h>
int main(void)
{
	char a[10005];
	int n, i, p, q;
	while(scanf("%d", &n) != EOF)
	{
		p=q=0;
		for(i=0; i<n; i++)
		{
			scanf("%d", &a[i]);
			if(a[i] != i%2?1:0)
				p++;
			if(a[i] != i%2?0:1)
				q++;
		}
		printf("%d\n", p>q?q:p);
	}
	return 0;
}


你可能感兴趣的:(c)