On 11/3/06, Derek <[EMAIL PROTECTED]> wrote:
Just out of curiosity, which of the following lines match? 0 1 1000000
From the problem statement:
"The definition implies that any sequence of a single integer is a match." Why? Because anything that does not *fail* passes. By the problem definition: "We are looking for sequences of n > 0 integers where the absolute values of the differences of successive elements are included in the set of numbers 1 through n - 1." So a sequence only fails when: * n == 0 (n < 0 doesn't make much sense) * a pair of elements have a delta outside [1, n) Since 1 != 0 and there are not pairs of elements with a delta outside [1, n), the sequence is a match. Jacob Fugal /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
