(水水水)zoj 1622 switch
来源:互联网 发布:交通大学网络教育好吗 编辑:程序博客网 时间:2024/04/28 08:37
ZOJ Problem Set - 1622
Switch Time Limit: 1 Second Memory Limit: 32768 KB
There are N lights in a line. Given the states (on/off) of the lights, your task is to determine at least how many lights should be switched (from on to off, or from off to on), in order to make the lights on and off alternatively.
Input
One line for each testcase.
The integer N (1 <= N <= 10000) comes first and is followed by N integers representing the states of the lights ("1" for on and "0" for off).
Process to the end-of-file.
Output
For each testcase output a line consists of only the least times of switches.
Sample Input
3 1 1 1
3 1 0 1
Sample Output
1
0
题意很简单要求是给你一组数,要求让这组数0 1 相间,如果不满足问至少调整几个就能满足题意。
- (水水水)zoj 1622 switch
- zoj 1622 Switch
- ZOJ 1622 Switch
- zoj 1622 switch
- ZOJ 1622 Switch
- ZOJ 1622 Switch
- zoj 1622 Switch 开关灯 简单枚举
- 1622 Switch
- zoj 1622 &&zoj 1949 && zoj 2679 (水~~)
- zoj 1622
- ZOJ-1622
- switch
- Switch
- Switch
- switch
- switch
- switch
- Switch
- 配置Flash Player mms.cfg 不存在的解决办法
- [转载]用dumper打开运行程序的core dump功能
- 单例模式(自己写的,没有技术含量,跟我一样的菜鸟看吧)
- span宽度解决方法
- 用C操作MySQL
- (水水水)zoj 1622 switch
- [转载]ARM MMU工作原理剖析
- Memcached在.NET中的应用(转载)
- 开始写博客
- Linux与Windows共享文件
- Sping 小结
- 一个笑话看透技术人生
- google map Api接口整理
- javaScript计算后出现一长串数字的现象:如何解决