在PC端文件播放器中,多画面管理时,将整个画面切割成N个矩形块。将打开显示与否的信息放在bitset容器中,今天就来对bitset做个小结 1.bitset可以表示二进制的有序集,用bitset来处理程序中的需要保存一组标志的操作很简便,下面总结一下bitset的一些函数。 2.定义和初始化bits ...
分类:
编程语言 时间:
2016-11-08 22:55:27
阅读次数:
228
1001题意:n个人,给m对敌对关系,X个好人,Y个坏人。现在问你是否每个人都是要么是好人,要么是坏人。 先看看与X,Y个人有联通的人是否有矛盾,没有矛盾的话咋就继续遍历那些不确定的人关系,随便取一个数3,与其相连的就是4,间隔就要相同,dfs搜过去就可以判断了 #include<bits/stdc ...
分类:
其他好文 时间:
2016-11-06 19:38:56
阅读次数:
279
题目链接:hdu_5968_异或密码 题意: 中午,不解释 题解: 前缀处理一下异或值,然后上个二分查找就行了,注意是unsigned long long 1 #include<bits/stdc++.h> 2 #define F(i,a,b) for(int i=a;i<=b;i++) 3 usi ...
分类:
其他好文 时间:
2016-11-05 20:50:13
阅读次数:
370
题目链接:hdu_5969_最大的位或 题意: 中文,还是自己看 题解: xjb贪心一下就行了 1 #include<bits/stdc++.h> 2 #define F(i,a,b) for(int i=a;i<=b;i++) 3 using namespace std; 4 typedef un ...
分类:
其他好文 时间:
2016-11-05 20:47:27
阅读次数:
211
题目链接:hdu_5963_朋友 题意: 中文,不解释 题解: 把样例拿出来看看,你会发现以x为节点是否能赢,就是与x相连的边权值的和或者异或是否为奇数。 1 #include<bits/stdc++.h> 2 #define F(i,a,b) for(int i=a;i<=b;i++) 3 usi ...
分类:
其他好文 时间:
2016-11-05 20:46:45
阅读次数:
220
原题: Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation a ...
分类:
其他好文 时间:
2016-11-05 11:27:28
阅读次数:
202
Problem: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, th ...
分类:
其他好文 时间:
2016-11-05 09:23:35
阅读次数:
175
题目链接:http://noi.openjudge.cn/ch0206/9271/ 同noi 踩方格,但是题目有问题,%12345,我也是看了discuss才知道的。 #include <bits/stdc++.h> using namespace std; unsigned long long d ...
分类:
其他好文 时间:
2016-11-04 23:24:39
阅读次数:
207
题目链接:hdu_5950_Recursive sequence 题意:递推求解:F(n) = 2*F(n-2) + F(n-1) + n4 和F(1) = a,F(2) = b; 题解: 一看数据范围,肯定矩阵加速递推,不过公式不是线性的,需要把公式转换为线性的公式 1 #include<bits ...
分类:
其他好文 时间:
2016-11-04 23:20:01
阅读次数:
267
分成K个块,每个块内部dfs解决,然后用树状数组统计第i个元素前面有多少怪物已经消失,来计算当前的下标 1 #include<bits/stdc++.h> 2 3 #define inf 0x3f3f3f3f 4 5 const int maxn=1000; 6 7 using namespace ...
分类:
编程语言 时间:
2016-11-01 09:27:02
阅读次数:
303