- //几百年没做题了,想不到这题还跑了个第一!
- //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
- }
problem 1622
最新推荐文章于 2023-04-04 19:29:31 发布