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=105⋅max(0,k−pop(u))k, where k=m−n+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
v11…v1m
…
vn1…vnm
Output Format:
In first line, output number of vectors you take. On next line, output vector numbers in any order.
S
s1…s|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.
Here S={2,3}. So, u=0110111⊕1100011=1010100.
pop(u)=pop(1010100)=3.
k=m−n+1=7−3+1=5.
So, score is score({2,3})=105⋅max(0,5−3)5=40000.