Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

雁过留声——暴力!

Posted by fanhqme at 2009-08-24 12:14:27 on Problem 3740
这题我的方法:暴力!
枚举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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator