poj 2449 模板题 A*+spfa 1 #include 2 #include 3 #include 4 #include 5 #define mt(a,b) memset(a,b,sizeof(a)) 6 using namespace std; 7 const int inf...
分类:
其他好文 时间:
2015-05-02 21:56:33
阅读次数:
145
1、利用数组对vector进行初始化方法 当然有许多方法,这里就讲一种。原因简单,其他方式请参见这个博文:http://www.cplusplus.me/1112.html int a[] = {-1, 1, 1, 1, -1};
vector n(a, a+sizeof(a)/sizeof(int...
分类:
其他好文 时间:
2015-05-02 19:26:24
阅读次数:
114
#include
#include
#include
using namespace std ;
const int maxn = 20 ;
int bit[maxn] ;
__int64 dp[maxn][maxn][2] ;//dp[i][j][1]第i位数为j时内有49的数量,0位不含
void init()
{
memset(dp , 0 ,sizeof(dp))...
分类:
其他好文 时间:
2015-05-02 18:16:32
阅读次数:
110
如何打开系统 OPENFILENAME opfn;
WCHAR strFilename[MAX_PATH];//存放文件名
//初始化
ZeroMemory(&opfn, sizeof(OPENFILENAME));
opfn.lStructSize = sizeof(OPENFILENAME);//结构体大小
//设置过滤
opfn.lpstrF...
简单01背包状态转移方程 dp[j] = max{dp[j], dp[j - volume[i]] + value[i]}; 1 #include 2 #include 3 #include 4 #define mem(a) memset(a, 0, sizeof(a)) 5 using names...
分类:
其他好文 时间:
2015-05-01 13:17:56
阅读次数:
154
size_tsize_t. A basic unsigned integer C/C++ type. It is the type of the result returned by sizeof operator. The type's size is chosen so that it coul...
分类:
编程语言 时间:
2015-04-30 17:49:26
阅读次数:
135
//数组初始化vectorint iarray[]={1,2,3,4,5,6,7,8,9,0};//count: iarray数组个数size_t count=sizeof(iarray)/sizeof(int);//int数组初始化 ivec3vector ivec3(iarray,iarray+...
分类:
其他好文 时间:
2015-04-30 15:54:36
阅读次数:
113
void* memset(void *s, int ch, size_t n); 将s所指向的某一块内存中的前n个字节的内容全部设置为ch指定的ASCII值。 例如:memset(lpMyStruct, 0, sizeof(MyStruct));初始化结构体。void *memcpy(void .....
分类:
其他好文 时间:
2015-04-30 10:24:49
阅读次数:
133
#include#include#define getpch(type)(type*)molloc(sizeof(type))#define NULL 0int n;float T1=0;T2=0;int times=0;struct JCB//作业控制块{ char name[15]; ...
分类:
其他好文 时间:
2015-04-30 10:20:15
阅读次数:
129
//SeqStack.h
typedefstructstack
{
DATAdata[SIZE+1];//数据元素
inttop;//栈顶
}SeqStack;
SeqStack*SeqStackInit()
{
SeqStack*p;
if(p=(SeqStack*)(malloc)(sizeof(SeqStack)))//申请栈内存
{
p->top=0;//设置栈顶为零
returnp;//返回指向栈的指针
}
returnN..
分类:
其他好文 时间:
2015-04-30 01:12:54
阅读次数:
205