题意
做法
结论1:对于((X_1,X_2,...,X_k)),其为红的充要条件为:令(Y_i=X_i-1),(prodlimits_{k=1}^K {sumlimits_{i=1}^k Y_ichoose Y_k}equiv 1(mod~2))
结论2:({a+bchoose a}equiv 1(mod~2))的充要条件为(aAnd b=0)
证明:
({a+bchoose a}equiv 1(mod~2)Longleftrightarrow (a+b)And a=0Longleftrightarrow aAnd b=0)
推论1:(prodlimits_{k=1}^K {sumlimits_{i=1}^k Y_ichoose Y_k}equiv 1(mod~2))的充要条件为(forall i,j(i eq j)s.t. Y_iAnd Y_j=0)
然后容斥或者把(L,R)一起记录然后随便dp就好了