Internet of Lights and Switches 湖南2015省赛 (前缀异或和+map) (未完待续)

探讨在拥有大量灯和开关的物联网环境中,如何通过连续按压开关来关闭所有灯的数学问题。每个开关控制一个或多个灯的状态,目标是在限定次数内找到所有可能的关闭方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

题面:
You are a fan of “Internet of Things”(IoT, 物联网), so you build a nice
Internet of Lights and Switches in your huge mansion. Formally, there
are n lights and m switches, each switch controls one or more lights,
i.e. pressing that switch flips the status of those lights (on->off,
off->on).

Initially, all the lights are on. Your task is to count the number of
ways to turn off all the lights by pressing some consecutive switches.
Each switch should not be pressed more than once. There is only one
restriction: the number of switches you pressed should be between a
and b (inclusive).

输入输出
There will be at most 20 test cases. Each test case begins with a line containing four integers n, m, a, b (2<=n<=50, 1<=a<=b<=m<=300000). Each of the following m lines contains a 01 string of length n. The i-th character is 1 if and only if that switch controls the i-th light. The size of the whole input file does not exceed 8MB.

输出描述
For each test case, print the case number, and the number of ways to turn off all the lights.

输入样例
2 4 1 4
01
10
11
00
2 4 3 3
01
10
11
00
6 3 1 3
101001
010110
101001

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值