Vector Space

4.5

2 votes
Mathematics, Hard, Approved
Problem

You are given n vectors of Zm2. So, that's just arrays of zeroes and ones of length m.

Let's define addition of multiple vectors as a vector whose i-th coordinate is equal to XOR of i-th coordinates of the vectors that is being added.

Find non-empty subset of the n given vectors such that their addition is a vector containing few number of ones.

Scoring:
Let u be the result vector of addition of the selected subset.

Define pop(v) as number of ones in v.

Score for one testcase defined as score=105max(0,kpop(u))k, where k=mn+1.

Goal is to maximize score, which corresponds to minimizing pop(v).

Input Format:

first line contains two integers n and m.

each of the next n lines describes a vector as a string containing m characters of either 0 or 1

nm
v11v1m

vn1vnm

Output Format:
In first line, output number of vectors you take. On next line, output vector numbers in any order.

S
s1s|S|

Testcase Generation
Each of values vij will be chosen randomly and equiprobable from {0,1}.

after the contest, all tests will be replaces with equivalent tests but with different seed then all solutions will be rejudged.

Test Groups
Test organized in 4 groups. Each group consist of 25 testcases.
Group #1
n=30,m=100.

Group #2
n=50,m=100.

Group #3
n=70,m=100.

Group #4
n=90,m=100.

Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

Here S={2,3}. So, u=01101111100011=1010100.
pop(u)=pop(1010100)=3.
k=mn+1=73+1=5.
So, score is score({2,3})=105max(0,53)5=40000.

Editor Image

?