Sorry for the very very long interruption between the daily dose.I will be regular from now.
The following is the day 7 question.
You are given a list of numbers and you will have a continuous flow of numbers coming in the list.
For every new number you need to tell that whether that number could be made using the numbers previously available in the list.
The first line contains number m (1 ≤ m ≤ 2000), showing how many numbers are there goo be in the list.
The next m lines contain the numbers in the order in which the numbers are being put in the list. Each number is a positive integer strictly less than 10600 that doesn’t contain leading zeroes.
For each number either print a 0 on the corresponding line, if the number cannot be represented as a XOR sum of numbers that are in the list, or print integer k showing how many numbers are in the representation and the indexes of these numbers. Separate the numbers by spaces. Each number can occur in the representation at most once.
Assume that the list was initially empty.
7 7 6 5 4 3 2 1
0 0 0 3 0 1 2 2 1 2 2 0 2 2 0 1
2 5 5
0 1 0
Comment any ideas or your way of approach to the question.