Let's talk about: the question is probably given a number of N, and then traversed from 1 to n. The state to be output is no, and then the factor that encounters N in the traversal process changes to the state once. Finally, the final state is output. It is also possible to simulate this process. However, we know that if N can be rounded out by m, it will certainly be divisible by N/m. Therefore, if n is not the number of workers, the state will definitely change even. According to this idea, the code efficiency will be improved a lot ~
Question:
Light, more light
The problemthere is man named "mabu" for switching on-off light in our university. He switches on-off the lights in a corridor. every bulb has its
A person named "mabu" is responsible for switching the lights of our school. He wants to switch a corridor light now. Each light bulb has its own switch,
Own toggle switch. That is, if it is pressed then the bulb turns on. Another press will turn it off. To save power consumption (or may be
If you press the light bulb, the light will be turned on. If you press it again, the light will be turned off. To save power (or he's crazy)
He is mad or something else) He does a peculiar thing. If in a corridor there is 'n' bulbs, he walks along the corridor back and forth 'n'
He did a very strange thing. If there is a 'n' lamp in the corridor, he will go back and forth n times along the corridor,
Times and in I 'th walk He toggles only the switches whose serial is divisable by I. He does not press any switch when coming back to his
In addition, only the switch of the bulb whose number can be divisible by I is performed at the time of the first time. He does not press the switch when returning to his initial position.
Initial position. a I 'th walk is defined as going down the corridor (while doing the peculiar thing) and coming back again.
The I-th walk means walking along the corridor (and doing the strange thing above) and then coming back.
Now you have to determine what is the final condition of the last bulb. Is it on or off?
Are you sure you want to turn the last light on or off?
The inputthe input will be an integer indicating the N 'th bulb in a corridor. Which is less then or equals 2 ^ 32-1. A zero indicates the end of input.
The input is an integer representing the nth lamp in the corridor. N is less than or equal to 2 ^ 32-1. input 0 indicates that the input is over. You do not need to output
You shoshould not process this input.
The outputoutput" Yes"If the light is on otherwise" No", In a single line.
After the light is on, "yes" is output; otherwise, "no" is output"
Sample Input
3624181910
Sample output
noyesno
Source code:
# Include <stdio. h> # include <math. h> int main () {double N; freopen ("input.txt", "r", stdin); While (scanf ("% lf", & n )) {If (n = 0) break; If (SQRT (n) = (unsigned) SQRT (n )) // determine whether the number of bytes is printf ("Yes \ n"); else printf ("NO \ n");} return 0 ;}