Without two consecutive ones
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given positive integer n, print all binary sequences of length n without consecutive ones, in lexicographical order.
Input
One positive integer n (n ≤ 20).
Output
Print each sequence in a separate line. Digits in a sequence must be separated with a space.
Examples
Input #1
Answer #1
Submissions 617
Acceptance rate 55%