当前位置: 首页 > news >正文

怎样建一个英文网站制作视频的手机软件

怎样建一个英文网站,制作视频的手机软件,织梦网站首页错位,最好的网站设计公司源码 php今天学习了神奇的线性基#xff0c;主要是在解决异或问题时比较有用。 详细的解释和证明有大佬珠玉在前#xff0c;如果感兴趣可以移步 补充一下自己的理解#xff1a; 可以联系线性代数极大无关组进行理解#xff0c;线性基就相当于异或的向量空间中的极大无关组#xff…今天学习了神奇的线性基主要是在解决异或问题时比较有用。 详细的解释和证明有大佬珠玉在前如果感兴趣可以移步 补充一下自己的理解 可以联系线性代数极大无关组进行理解线性基就相当于异或的向量空间中的极大无关组线性代数中的是加减的向量空间因此线性基有极大无关组的性质 向量的个数一定可以表示向量空间内任意一个向量向量空间中不包括零向量 但是我们在计算线性基的时候为什么要从最高位开始选呢这其实只是为了方便使用相当于我们在求极大无关组的时候习惯于从左往右进行初等变换的习惯一样。同样的我们也可以从低位开始选也是不会影响的可是这样选出来不方便我们使用从高位到低位方便求最大值最小值 在求第K大的时候我们还需要对线性基进行重建这相当将行阶梯形阵变换为行最简形矩阵一样。 这样我们就可以从大往小依次找出第k大。可能会疑惑为什么不考虑后面的1的影响只考虑最高位1的影响就可以呢因为高位的1的影响更大高位有1没1的影响大于后面那些数字的影响所以只考虑高位的影响就可以。 这里给出模板题的代码。 【题目描述】 XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let CA XOR B, then for each bit of C, we can get its value by check the digit of corresponding position in A and B. And for each digit, 1 XOR 1 0, 1 XOR 0 1, 0 XOR 1 1, 0 XOR 0 0. And we simply write this operator as ^, like 3 ^ 1 2,4 ^ 3 7. XOR is an amazing operator and this is a question about XOR. We can choose several numbers and do XOR operatorion to them one by one, then we get another number. For example, if we choose 2,3 and 4, we can get 2345. Now, you are given N numbers, and you can choose some of them(even a single number) to do XOR on them, and you can get many different numbers. Now I want you tell me which number is the K-th smallest number among them. Input First line of the input is a single integer T(T30), indicates there are T test cases. For each test case, the first line is an integer N(1N10000), the number of numbers below. The second line contains N integers (each number is between 1 and 10^18). The third line is a number Q(1Q10000), the number of queries. The fourth line contains Q numbers(each number is between 1 and 10^18) K1,K2,…KQ. Output For each test case,first output Case #C: in a single line,C means the number of the test case which is from 1 to T. Then for each query, you should output a single line contains the Ki-th smallest number in them, if there are less than Ki different numbers, output -1. Sample Input 2 2 1 2 4 1 2 3 4 3 1 2 3 5 1 2 3 4 5Sample Output Case #1: 1 2 3 -1 Case #2: 0 1 2 3 -1【AC代码】 #includecstdio #includecstring #includeiostream #includealgorithm #includevector #includequeue #includeset #includeclimits #includecstdlib #includecmathusing namespace std;typedef long long ll;const int MAXN10005; int n,q; ll k,tmp; struct L_B {ll b[65],p[65];int cnt,flag;L_B(){memset(p,0,sizeof(p));memset(b,0,sizeof(b));cntflag0;}inline bool insert(ll x){for(int i62;i0;--i)if(x(1lli)){if(b[i])x^b[i];else{b[i]x;return true;}}flag1;return false;}ll get_max(){ll ret 0;for(int i62;i0;--i)if((ret^b[i])ret)ret^b[i];return ret;}ll get_min(){if(flag)return 0;for(int i0;i62;i)if(b[i])return b[i];return 0;}inline void rebuild(){for(int i 1;i 62;i)if(b[i])for(int j0;ji;j)if(b[i](1llj))b[i]^b[j];for(int i0;i62;i)if(b[i])p[cnt]b[i];}ll kth(ll k){if(flag)--k;if(k0)return 0;ll ret 0;if(k(1llcnt))return -1;for(int i0;icnt-1;i)if(k(1lli))ret^p[i];return ret;} }; /* L_B merge(const L_B n1,const L_B n2) {L_B ret n1;for(int i 0;i 62;i)if(n2.b[i])ret.insert(n2.b[i]);ret.flag n1.flag | n1.flag;return ret; } */ int main() {int T;scanf(%d,T);for(int Case1;CaseT;Case){L_B lis;scanf(%d,n);for(int i 1;i n;i){scanf(%lld,tmp);lis.insert(tmp);}scanf(%d,q);lis.rebuild();printf(Case #%d:\n,Case);while(q--){scanf(%lld,k); printf(%lld\n,lis.kth(k));}}return 0; }
http://www.pierceye.com/news/944069/

相关文章:

  • 黑龙江 建设监理协会网站开发公司资质查询
  • 中标建设集团有限公司 网站怀化主要网站
  • 国外网站seo国外企业网站建设
  • 很简单的做设计的网站网站建设会议讲话
  • 泉港区建设局网站廉政配置wordpress环境
  • 公众号开发培训网站谷歌优化怎么做
  • 网站设计合理汕头市潮南区紧急提醒
  • 国外网站流量查询企业网站报价单
  • 聊城高唐网站建设公司wordpress设置域名
  • 有帮忙做儿童房设计的网站吗东莞横沥网站制作
  • 国外网站模板欣赏WordPress 编辑器修改默认字号
  • 厦门同安网站建设视频购物网站开发方案
  • 什么是建设网站的主题兼职做问卷调查的网站
  • 装饰网站建设软件下载公司旅游视频网站模板免费下载
  • aws网站建设个体户做网站去哪里做
  • 用四字成语做网站域名好吗宁波网站推广专业服务
  • 深圳网站建设公司是网络推广网上营销
  • 网站视频站建设教程和仿qq商城版淘宝客网站源码模板+带程序后台文章dede织梦企业程序
  • 温州红酒网站建设长沙移动网站建设
  • 如何制作网站?企业网站制作步骤
  • 桓台县旅游网站建设购物网站建设技术难点
  • 单页网站推广网站qq链接怎么做
  • wordpress仿站步骤平乡网站建设
  • 青岛高端网站建设公司新网站seo技术
  • 手机网站后台甘肃网络推广技巧
  • 做co网站阿里云建站方案
  • 如何做网站首页优化怎么查网站点击量
  • 北京网站制作百度推广潜江资讯网二手房出售
  • 北京建网站软件深圳企业网站
  • 网站关键词互点备案网站简介怎么写