problem 1622
来源:互联网 发布:centos netsnmp 编辑:程序博客网 时间:2024/06/01 10:25
- //几百年没做题了,想不到这题还跑了个第一!
- //2008-09-19 17:02:34 C++ 0ms 256Kb
- #include<stdio.h>
- void solve(int n)
- {
- int res1 = 0, res2 = 0;
- for(int i = 0; i < n; i++)
- {
- int light;
- scanf("%d", &light);
- light == (i & 1) ? res1++ : res2++;
- }
- printf("%d/n", (res1 >= res2 ? res2 : res1));
- }
- int main()
- {
- #ifndef ONLINE_JUDGE
- freopen("1622.txt", "r", stdin);
- #endif
- int n;
- while(scanf("%d", &n) != EOF )
- solve(n);
- #ifndef ONLINE_JUDGE
- fclose(stdin);
- #endif
- }