prelude_to_self-describing_sequence
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
prelude_to_self-describing_sequence [2011/09/20 06:11] – created jtkorb | prelude_to_self-describing_sequence [2011/09/20 06:28] – jtkorb | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Prelude to Self-describing Sequence ====== | ===== Prelude to Self-describing Sequence ====== | ||
- | First, start by reading the problem statement for [[http:// | + | First, start by reading the problem statement for [[http:// |
+ | |||
+ | For this prelude, create an array, '' | ||
+ | |||
+ | n | ||
+ | f(n) 1 | ||
+ | fr[n] 1 | ||
+ | |||
+ | This array is a kind of run-length encoding of function '' | ||
===== Input ===== | ===== Input ===== | ||
- | Like Pairsumonious Numbers, the input is a sequence of test cases, one per line. The first number on the line is N, followed by N*(N-1)/2 additional numbers. | + | Input consists of a sequence of integers, one per line. The last entry is a 0, which should not be processed. |
===== Output ===== | ===== Output ===== | ||
- | Print a line of output for each line of input. The first number on the line is N*(N-1)/2, followed by the N*(N-1)/2 input numbers in sorted order, from lowest to highest. | + | For each non-zero |
===== Sample Input ===== | ===== Sample Input ===== |
prelude_to_self-describing_sequence.txt · Last modified: 2011/09/20 06:34 by jtkorb