Login Register


[challenge] light bulbs filter_list
Author
Message
[challenge] light bulbs #1
Rules:
Your program may be written in any language of your choice
Your program may not take longer than 25 seconds to compute the answer

Problem:
You have a string of N light bulbs, all of which are turned off. Every second (S), light bulbs that are multiples of S toggle their state (off->on, on->off). After T seconds, what is the state of the light bulb in question (Q)?

Inputs:
N, T, Q

Outputs:
state(Q)

+1 rep and 50NSP if your program computes the correct result in under 5 seconds.

NOTE: a random number generator won't work, I will test each program a random number of times.

Limits:
10<N<4,294,967,296
100<T<1,000,000
Q is a 1-bit integer

EDIT: PLEASE include an example of how to compile and run if your language is not C/C++/Java. Sorry @Eclipse, lets see how it handles

Reply





Messages In This Thread
[challenge] light bulbs - by phyrrus9 - 06-21-2015, 12:55 PM
RE: [challenge] light bulbs - by Eclipse - 06-21-2015, 07:22 PM
RE: [challenge] light bulbs - by phyrrus9 - 06-21-2015, 09:28 PM
RE: [challenge] light bulbs - by Eclipse - 06-21-2015, 09:31 PM
RE: [challenge] light bulbs - by phyrrus9 - 06-21-2015, 09:37 PM
RE: [challenge] light bulbs - by Eclipse - 06-21-2015, 09:37 PM



Users browsing this thread: