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

终于到70了!!!!

Posted by sxd31415926 at 2011-08-01 16:51:45 on Problem 3274
原来此题是哈希,一开始没看出来。
发现一条性质:如果一段区间是平衡的,那么这段区间的所有数xor一下结果是0 或 2^k-1,这样就可以预处理出s[i],表示a[0] xor a[1] xor a[2] xor ... xor a[i]。要看[x,y]是否平衡,只需看s[y] xor s[x-1]是否等于0或2^k-1就行了。

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