trick1

jys posted @ Jul 19, 2014 05:32:55 PM in 未分类 , 816 阅读

问题:给定数列A[],若干询问,每次给定X,求有多少A[i]&X=X

值域与n同阶

暴力枚举子集要O(3^(logn))

可以这么搞

	for(i=0;i<20;++i)
	for(j=0;j<=N;++j)
	if(j&(1<<i))b[j-(1<<i)]+=b[j];

复杂度靠谱

每次询问O(1)

Avatar_small
NCERT Economics Ques 说:
2022年9月23日 01:36

Candidates can download NCERT Economics Sample Paper 2023 Class 9 which have prepared step by step solutions with detailed explanations which are formulated by subject masters. We hope these model papers must help the students to fulfill their wish by getting good rank in all formats of exams conducting by NCERT Board such as Term-1, NCERT Economics Question Paper Class 9 Term-2 and other types of exams.Candidates can download NCERT Economics Sample Paper 2023 Class 9 which have prepared step by step solutions with detailed explanations which are formulated by subject masters. We hope these model papers must help the students to fulfill their wish by getting good rank.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter