http://acm.hdu.edu.cn/showproblem.php?pid=1558先判断线段相交,然后用并查集合并。 1 #include 2
#include 3 #include 4 #define maxn 20000 5 using namespace std; 6 7 i...
分类:
其他好文 时间:
2014-05-16 05:18:02
阅读次数:
353
#include#include#include#include#includeusing
namespace std;#define MAXN 101000int sz;int ch[MAXN][2],f[MAXN];int
rev[MAXN],col[MAXN],node[MAXN];int l...
分类:
其他好文 时间:
2014-05-16 05:01:25
阅读次数:
412
#include#include#include#includeusing namespace
std;#define N 110000int pre[N],ch[N][2];int e[N],ne[N*2],v[N*2];int nn,m;int
col[N];int lc[N],sm[N],rc...
分类:
其他好文 时间:
2014-05-15 17:00:37
阅读次数:
300
1 #include 2 #include 3 using namespace std; 4
5 int main() 6 { 7 string str=""; 8 string str2=""; 9 char max;10 while
(getline(ci...
分类:
其他好文 时间:
2014-05-15 16:20:41
阅读次数:
258
发送端:#include #include #include using namespace
std;#include #include #include using namespace boost::interprocess;int num =
0;mapped_region *mp_r;void...
分类:
其他好文 时间:
2014-05-15 16:05:06
阅读次数:
258
关于_name_和_main_的具体含义如下:_name_:在模块中就是模块名,在类中就是类名_main_:模块自身”The namespace for a
module is automatically created the first time a module is imported. Th...
分类:
编程语言 时间:
2014-05-15 15:26:00
阅读次数:
287
快速排序最坏情况下时间复杂度是O(n*n),但是它平均时间复杂度是O(N*logn),并且常数因子很小,可实现就地排序,所以被作为内排序的常用排序方法.
#include
using namespace std;
void swap(int &i,int &j)
{
int temp=i;
i=j;
j=temp;
}
int partition(int *vector...
分类:
其他好文 时间:
2014-05-15 06:05:35
阅读次数:
254
//拷贝构造函数,什么时候算是 “合适的时候”,才会合成呢~~~
#include
using namespace std;
class A
{
public:
A(char *_str):str(_str),x(0){}
//A(const A&a){cout
//如果没有定义的话,对于类A来说,编译器依然不会合成,因为此时的对象之间的...
分类:
其他好文 时间:
2014-05-15 05:11:13
阅读次数:
334
/*题目描述:
给定两个整数A和B,其表示形式是:从个位开始,每三位数用逗号","隔开。现在请计算A+B的结果,并以正常形式输出。 输入:
输入包含多组数据数据,每组数据占一行,由两个整数A和B组成(-10^9 #include using namespace std;int main() {
st...
分类:
其他好文 时间:
2014-05-14 12:38:11
阅读次数:
186
#include using namespace std;int
GreatestCommonDivisor(int m,int n) //辗转相除法求最大公约数{ int r; do { r = m % n; m = n;
...
分类:
编程语言 时间:
2014-05-14 11:18:00
阅读次数:
675