码迷,mamicode.com
首页 >  
搜索关键字:include    ( 84546个结果
[最大子序列和]Hdu 5280 Senior's Array
题意:一个序列,在其中一个数必须替换成给定数字p的条件下,求最大连续子序列之和。依次把每一个数替换成p,求每次的最大连续和,找出最大值。O(n^2)。#include #include #include #include typedef long long ll;using namespace st...
分类:其他好文   时间:2015-07-15 22:14:10    阅读次数:110
中介模式 Mediator
两个类之间通信,不通过直接通信的方式,而是中间加一层类似于中介的类,中介者模式,就类比租房时找中介那会// Mediator.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include...
分类:其他好文   时间:2015-07-15 22:13:16    阅读次数:141
POJ1740|A NEW STONE GAME|博弈论
DescriptionAlice and Bob decide to play a new stone game.At the beginning of the game they pick n(1#include#includeusing namespace std;int n,a[11];int...
分类:其他好文   时间:2015-07-15 22:10:37    阅读次数:131
linux系统编程:进程间通信-mmap
进程间通信-mmap #include void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); int munmap(void *addr, size_t length); mmap本质是把内存与硬盘上的文件同步。某块内存中的内容会同步到硬盘文件上,即把文件映射到内存。故通过对同一文件的读写达到进程间的通信。 参数解释: addr:指定对哪儿块内存实行映射。NULL表示...
分类:系统相关   时间:2015-07-15 21:07:04    阅读次数:219
codeforces 558E A Simple Task 线段树
题目链接 题意较为简单。 思路: 因为只有26个字母,所以用26棵线段树维护就好了,比较容易。 #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace st...
分类:其他好文   时间:2015-07-15 21:06:45    阅读次数:123
hdu 3496 二维费用的01背包
算是比较简单的二维费用背包了吧,注意在某一维上要求“装满”。另外:对于多维费用的背包,最内层的循环可以逆着写,想一想,为什么。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int ...
分类:其他好文   时间:2015-07-15 20:57:12    阅读次数:154
nyoj 16 最长上升子序列变形
经典矩形嵌套问题,先排序再求LIS。需要注意在枚举j的时候x和y都要小于i才行。 1 #include 2 #include 3 using namespace std; 4 5 const int N = 1000; 6 int dp[N]; 7 8 struct Node 9 {10 ...
分类:其他好文   时间:2015-07-15 20:51:32    阅读次数:102
C++中多态中构造函数与析构函数的调用
做个实验,看一下成员变量的构造析构,父类子类的构造析构,以及虚函数对调用的影响。 1 #include 2 using namespace std; 3 4 class Member 5 { 6 public: 7 Member(int n):m_n1(n) 8 { 9 ...
分类:编程语言   时间:2015-07-15 20:46:31    阅读次数:166
HDU 2601 An easy problem
(i+1)*(j+1)=n+1转换成上面这个式子,也就是问n+1的因子有几个#include#include#include#includeusing namespace std;int main(){ int T; scanf("%d",&T); while(T--) { ...
分类:其他好文   时间:2015-07-15 20:45:35    阅读次数:135
数据结构复习之十字链表的应用
#include #include#include#include #define MAX_VERTEX_NUM 20 using namespace std;typedef struct ArcBox{ int tailVex, headVex;//该弧的尾和头顶点的位置 st...
分类:其他好文   时间:2015-07-15 20:42:16    阅读次数:140
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!