# include
# include
# include
# include
# define N 100005
using namespace std;
vectorg[N];
int node[N];
int slove(int x)
{
int sum=0,i;
for(i=0;i<g[x].size();i++)
{
sum+=node[g[x][i]];
}
re...
分类:
其他好文 时间:
2014-07-26 15:21:40
阅读次数:
224
题意:给一个字符串(#include #include #include #include #include #define ll long longusing namespace std;int Maxn, N ;int sum[1005];struct BlockList{ int siz...
分类:
其他好文 时间:
2014-07-26 14:58:11
阅读次数:
244
内部也是相交#include #include #include #include using namespace std;struct point{ int x,y;};struct edge{ point start,end;}line[4],the;void swaped(int &x,int...
分类:
其他好文 时间:
2014-07-26 14:31:00
阅读次数:
272
C++结构体定义struct inflatable{ char name[20]; float volume; double price;}C++创建结构本:inflatable guest={ "Glorious Gloria", 1.88, 29.99};在C中是要加上struc...
分类:
编程语言 时间:
2014-07-26 14:25:00
阅读次数:
238
代码如下: + (NSString*) deviceString { ? ? // 需要#import "sys/utsname.h" ? ? struct utsname systemInfo; ? ? uname(&systemInfo); ?? ? ? ? NSString *deviceString = [NSString stringWithC...
分类:
移动开发 时间:
2014-07-26 03:35:37
阅读次数:
308
核心思想就是节点上记录最大值和最小值,如果max=p时,只在节点改变add值,不用往子树遍历;否则就往子树进行递归。
#include
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 2e5+50;
int N, P;
struct node{
int l, r,...
分类:
其他好文 时间:
2014-07-26 03:01:26
阅读次数:
225
类引入
到目前为止我们所写的自定义类型都是关键字struct,从现在起我们将采用class方式定义类,这种方式对于学习过其他高级语言包括脚本(Such as Python)的人来说再熟悉不过了.
但是在写之前我们还是需要比较一下用struct和class之间有什么区别.
首先对于struct,在C兼容性方面很重要,尽管C++是有别于C的另一门语言,但许多程序还是必须与C交互,C++有两个重要...
分类:
编程语言 时间:
2014-07-26 02:32:26
阅读次数:
216
开一个数组做成队列来搜索就好了。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 const int MAXN=100010; 9 10 typedef struct po...
分类:
其他好文 时间:
2014-07-26 01:28:36
阅读次数:
260
非常简陋的一段小程序,演示怎样显示点阵字库。有时间的时候再详解。#include #include struct HzkInfoStruct{ int HzkSelect; int HzkSquare; char * fileName; FILE * file; int martixBytesCou...
分类:
其他好文 时间:
2014-07-26 00:46:46
阅读次数:
327
分析: 基础的欧拉路算法,变化在于要求每条边正向和反向各走一遍。 链式前向星构图,只要标记走过的单向边,边找边输出即可。code#include #include using namespace std;struct node { int v, ne;} edge[100009];int h...
分类:
其他好文 时间:
2014-07-26 00:22:06
阅读次数:
221