| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
雁过留声——暴力!这题我的方法:暴力!
枚举65536种可能,一次判断
一个trick:
把每列都依次转换成二进制。
设当前枚举到得集合(也用二进制表示)为i
设第j列的二进制为Cj则必有
t=(i&Cj)属于{1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192...32728}
或t && t==(t&-t)
不知道不用二进制的效果。反正我313msAC了。
有人用高斯消元之类,我没有深入考虑。
如此小的数据,还是人间暴力是沧桑!
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator