码迷,mamicode.com
首页 >  
搜索关键字:include    ( 84546个结果
NOI2012 骑行川藏
http://www.lydsy.com/JudgeOnline/problem.php?id=2876表示完全不会。。。。。。还是跪拜大神吧http://www.cnblogs.com/GerynOhenz/p/4698451.html#include#include#include#includ...
分类:其他好文   时间:2015-08-08 09:02:47    阅读次数:103
c++动态内存分配与释放
一般变量的分配与释放#include<iostream> usingnamespacestd; intmain() { int*p=newint(4); *p=10; cout<<*p<<endl; deletep; return0; }数组变量的分配与释放 #include#include<iostream> usingnamespacestd; intmain() { char*p=newchar[10]; p="he..
分类:编程语言   时间:2015-08-08 06:48:35    阅读次数:134
_DataStructure_C_Impl:Array
#include #include #include #define MaxArraySize 2 typedef int DataType; typedef struct{ DataType *base; //数组元素的基地址 int dim; //数组的维数 int *bounds; //数组的每一维之间的界限的地址 int *constants; //数组存储映像常量基地址 }Ar...
分类:其他好文   时间:2015-08-08 06:46:42    阅读次数:216
_DataStructure_C_Impl:稀疏矩阵三元组
#include #include #define MaxSize 200 typedef int DataType; typedef struct{ //三元组类型定义 int i,j; DataType e; }Triple; typedef struct{ //矩阵类型定义 Triple data[MaxSize]; int rpos[MaxSize]; //用于存储三...
分类:其他好文   时间:2015-08-08 06:45:52    阅读次数:151
I - Tunnel Warfare - hdu 1540
#include //未完成#include using namespace std;const int maxn=50005;#define lson rt>1; }}a[maxn<<2];void bst(int rt,int l,int r){ a[rt].l=l;a[rt].r=...
分类:其他好文   时间:2015-08-08 06:32:06    阅读次数:107
莫比乌斯反演简单题
莫比乌斯函数这里简述一下莫比乌斯函数: 若d=1 那么μ(d)=1 若d=p1p2…pr (r个不同质数,且次数都为一)μ(d)=(-1)^r 其余 μ(d)=0 GCD题目传送:HDU - 1695 - GCD题意:求[1,n],[1,m]中gcd为k的两个数的对数思路:这里可以转化一下,也就是[1,n/k],[1,m/k]之间互质的数的个数,模板题AC代码:#include <m...
分类:其他好文   时间:2015-08-08 01:24:02    阅读次数:157
poj 1087 A Plug for UNIX 【最大流】
题目连接:http://poj.org/problem?id=1087题意: n种插座 ,m个电器,f组(x,y)表示插座x可以替换插座y,问你最多能给几个电器充电。解法:起点向插座建边,容量1,电器向汇点建边,容量1,插座向电器建边,容量1,可以替换的插座间建边,容量无穷大。然后套板子。。。求最大流。代码:#include #include #incl...
分类:其他好文   时间:2015-08-08 01:22:26    阅读次数:138
【转】HDU 1425 sort:哈希入门
#include#include#includeusing namespace std;const int Size = 1000000;int Hash[Size+1];int main(){ int n, m, num; while(cin>>n>>m) ...
分类:其他好文   时间:2015-08-08 01:16:18    阅读次数:139
数论 - 线性筛法与积性函数
首先以求1000000以内的素数为例来探讨筛法 Eratosthenes筛法(埃拉托斯特尼筛法)时间复杂度:O(N*loglogN) 空间复杂度:O(N)代码:#include #include #include #include #include #include #include #inclu...
分类:其他好文   时间:2015-08-08 00:06:15    阅读次数:144
poj 3320 Jessica's Reading Problem(尺取法+map/hash)
题目:http://poj.org/problem?id=3320 题意:给定N个元素的数组,找出最短的一段区间使得区间里面的元素种类等于整个数组的元素种类。 分析:暴力枚举区间的起点x,然后找到最小的y,使得区间[x,y]满足条件,x向有移位后变成x',现在的y'肯定不至于在y的左边。存状态的话map和hash都可以。 map代码: #include #include #includ...
分类:其他好文   时间:2015-08-07 23:58:49    阅读次数:471
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!