原文:[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