#include
#include
#include
#include
#include
using namespace std;
#define maxn 1000 + 10
int p[maxn], n, m;
//bool mark[maxn];
//int Rank[maxn];
void init()
{
for(int i=1; i<=n; i++)
p...
分类:
其他好文 时间:
2015-04-10 22:07:12
阅读次数:
129
今天在一个类中定义了一个索引器,但是再定义一个叫Item的属性的时候发现编译器报错: 1 namespace Test 2 { 3 class Program 4 { 5 static void Main(string[] args) 6 { 7 ...
分类:
其他好文 时间:
2015-04-10 22:05:53
阅读次数:
119
#include
using namespace std;
void f(int x, int a= 3, float b = 1.1);
int main() {
f(0);
return 0;
} ///:~
void f(int x, int a= 3, float b= 1.1)
/*
error C2572: 'f' : redefinition of default pa...
分类:
编程语言 时间:
2015-04-10 22:05:36
阅读次数:
140
题意:给出一张无向图,判定是否有环,判定是否为一棵树;思路:并查集判环,唯一祖先;#include#include#includeusing namespace std;#define M 0x3f3f3f3fint fa[500010],mark[500010];void init(){ f...
分类:
其他好文 时间:
2015-04-10 21:59:38
阅读次数:
105
#include#include#includeusing namespace std;int next[50005];char s[50005],t[50005];void getnext()//next[]数组,next[j]的值表示P[0...j-1]中最长后缀的长度等于相同字符序列的前缀。{...
分类:
其他好文 时间:
2015-04-10 21:59:24
阅读次数:
131
#includeusing namespace std;#define Maxsize 100class Qune{public: int data[Maxsize]; int front; int rear;};void Qinsert(Qune&A,int x); //入队int Qdelet....
分类:
编程语言 时间:
2015-04-10 21:51:12
阅读次数:
183
最近正在学习C++,对namespace的概念颇为好奇,但网上资料很零散,又不愿意去翻那本厚厚的C++ Primer Plus。遂自己试验。1. 和是不一样,前者没有后缀,实际上,在你的编译器include文件夹里面可以看到,二者是两个文件,打开文件就会发现,里面的代码是不一样的。后缀为.h的头文件...
分类:
编程语言 时间:
2015-04-10 21:43:28
阅读次数:
138
反质数:设f(n)表示n个约数的个数,如果对于任意x有0 2 #include 3 #include 4 #include 5 using namespace std; 6 7 typedef long long LL; 8 int p[]={2,3,5,7,11,13,17,19,23,2...
分类:
其他好文 时间:
2015-04-10 21:42:24
阅读次数:
144
#include #include using namespace std;int main(){ int num = -1; unsigned int s = num; //当前位级表示即为最大无符号数 cout > 1; intSize = intS...
分类:
编程语言 时间:
2015-04-10 21:40:02
阅读次数:
153
只是为了存模板~
#include
#include
#include
using namespace std;
const int maxn = 100005;
int n,m;
int sorted[maxn];
int tree[20][maxn]; //第i层归并之后的结果
int toleft[20][maxn]; //第i层第j个数左边有几个分到左边(包括j自己)
voi...
分类:
其他好文 时间:
2015-04-10 20:19:08
阅读次数:
170