由于每个元素贡献是线性的,那么等价于求每个元素出现在多少个异或和为$0$的子集内.因为是任意元素可以去异或,那么自然想到线性基.先对整个集合A求一遍线性基,设为$R$,假设$R$中元素个数为$r$,那么任取一个不在$R$内的元素,$R$中肯定存在一种取法能和这个元素异或和为$0$.同理,取定一个不在$R$内的元素,再随便取另外任意个不在$R$内的元素,$R$内仍然存在一种取法使得这个异或和为$0$.那么每个不在$R$内的元素包含在$2^{n - r - 1}$个集合内(其他不在$R$内的元素可以…
Solved A HDU 6298 Maximum Multiple Solved B HDU 6299 Balanced Sequence Solved C HDU 6300 Triangle Partition Solved D HDU 6301 Distinct Values E HDU 6302 Maximum Weighted Matching F HDU 6303 Period Sequence Solved G HDU 6304 Chiaki Sequence Revisi…
Problem F. Grab The Tree Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 2004 Accepted Submission(s): 911 Problem Description Little Q and Little T are playing a game on a tree. There are …
Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1770 Accepted Submission(s): 1089 Problem Description Alice and Bob are playing a game. The game is played on a set of positive integers…
Maximum Multiple Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3985 Accepted Submission(s): 926 Problem Description Given an integer n, Chiaki would like to find three positive integers x,…