原文:[LeetCode] Bulb Switcher II 灯泡开关之二

There is a room withnlights which are turned on initially and buttons on the wall. After performing exactlymunknown operations towards buttons, you need to return how many different kinds of status o ...

2017-09-26 10:53 5 4202 推荐指数:

查看详情

[LeetCode] Bulb Switcher 灯泡开关

There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle ...

Tue Jan 05 04:06:00 CST 2016 0 11599
算法题|-灯泡开关问题

问题描述: 有编号1~100个灯泡,起初所有的灯都是灭的。有100个同学来按灯泡开关,如果灯是亮的,那么按过开关之后,灯会灭掉。如果灯是灭的,按过开关之后灯会亮。现在开始按开关。第1个同学,把所有的灯泡开关都按一次(按开关灯的编号: 1,2,3,......100)。第2个同学,隔一个灯按一次 ...

Tue Jan 15 00:33:00 CST 2019 2 1286
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM