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 every third bulb (turning on if it's off or turning off if it's on). For the nth round, you only toggle th…
JS学习笔记1(学自W3school) function changeImage() { element = document.getElementByIdx_x('myimage') if (element.src.match("bulbon")) { element.src="http://www.w3school.com.cn/i/eg_bulboff.gif"; }else{ element.src="http://ww…
题意:把一个整数N(1 <= N <= 100000)拆分不超过N的正整数相加,有多少种拆法. 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4651 ——>>好经典的问题,但数好大,比赛卡住了... 原来,这个问题有个公式计算: q[i]为第i个广义五边形数. #include <cstdio> using namespace std; const int maxn = 100000; const int mod = 1…
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 every third bulb (turning on if it's off or turning off if it's on). For the i-th round, you toggle every …
There is a room with n lights which are turned on initially and 4 buttons on the wall. After performing exactly munknown operations towards buttons, you need to return how many different kinds of status of the n lights could be. Suppose n lights are…