码迷,mamicode.com
首页 >  
搜索关键字:include    ( 84546个结果
bzoj 1096: [ZJOI2007]仓库建设
dp是很好想的了,关键是数据太大,普通dp肯定超时,所以一定有用某种优化,dp优化也就那么几种,这道题用的是斜率优化,先写出普通的状态转移方程: dp[i] = min{ dp[j] + Σ ( p[k] * (x[i] - x[k] ) ), j+1 #include #include #inc....
分类:其他好文   时间:2014-05-09 16:05:35    阅读次数:301
编译系统对跨平台代码的支持
问题起因项目需要跑在不同的平台上不希望代码中掺杂大量的define宏做平台判断(有洁癖呀~~~)定义一些通用宏来处理只能解决一些类型差异的问题处理将跨平台代码写入不同的文件夹下 os/linux 和 os/win在外部暴露的.h文件加入判断宏//file: public.h #ifdef WIN32 #include "os/windows/public.h" #else #include "os...
分类:其他好文   时间:2014-05-09 14:46:23    阅读次数:246
bzoj2744: [HEOI2012]朋友圈
#include#include#include#includeusing namespace std;int nn;#define in(x) scanf("%d",&x)#define in2(x,y) scanf("%d%d",&x,&y)#define in3(x,y,z) scanf("%...
分类:其他好文   时间:2014-05-09 13:24:28    阅读次数:275
Boost智能指针——weak_ptr
循环引用:引用计数是一种便利的内存管理机制,但它有一个很大的缺点,那就是不能管理循环引用的对象。一个简单的例子如下:#include#include#include#includeclassparent;classchildren;typedefboost::shared_ptr parent_pt...
分类:其他好文   时间:2014-05-09 13:01:22    阅读次数:326
获得进程句柄
1 #include "windows.h" 2 #include "iostream" 3 4 void main(){ 5 HANDLE hprocessThis=GetCurrentProcess(); 6 7 DWORD dwPriority=GetPriorityCl...
分类:其他好文   时间:2014-05-09 09:14:15    阅读次数:267
【C++】【一日一练】通过友元访问或改变类的私有成员【20140508】
题目来源:BeginnersLabAssignmentsCodeExamplesAccessingPrivateDataMembersinC++.Thisisaflawinthelanguage/* **Description:AccessingPrivateDataMembersinC++ **Date:2014-05-08 **Author:xyq */ #include<iostream> #include<string> usingnamespacestd; clas..
分类:编程语言   时间:2014-05-09 06:58:48    阅读次数:332
相加之和为某个数n,求方法数 ------------ 动态规划的方法
uva11137 n3可转化为n2(立方和为n的方法数)/*ID: neverchanjePROG:LANG: C++11*/#include#include#includetypedef long long ll;using namespace std;int n;long long d[23][...
分类:其他好文   时间:2014-05-09 06:38:39    阅读次数:382
C语言的外部变量extern
C语言的存储类型可分为:extern、auto、static、register。 外部变量定义在函数之外,通过同一个名字对外部变量的所有引用(即使这种引用来自于单独编译的不同函数),实际上都是引用同一个对外部变量的所有引用(C标准中把这一性质称为外部链接)。因此外部变量可以在全局范围内访问。 getChar.c: #include #include exter...
分类:编程语言   时间:2014-05-09 06:26:36    阅读次数:330
循环顺序队列
#include using namespace std; const int MAXQSIZE = 5; //队列类 template struct LinkList { T * data;//指向连续的数据存储区域 int front;//头指针 指向第一个元素 int rear;//尾指针 如果队列不为空指向最后元素的下一个位置 }; //构造一个空队列 template void...
分类:其他好文   时间:2014-05-09 06:07:53    阅读次数:248
最小机器重量 分支限界
#include #include int bottom,Flag2;int COST,n,m,*bestx;int cc,cw,w[100][100];int cp,c[100][100];int bestw=1000;int Flag;int E;int bext[100];int bestxu...
分类:其他好文   时间:2014-05-09 05:47:50    阅读次数:273
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!