码迷,mamicode.com
首页 >  
搜索关键字:include    ( 84546个结果
hdu 4587 2013南京邀请赛B题/ / 求割点后连通分量数变形。
题意:求一个无向图的,去掉两个不同的点后最多有几个连通分量。  思路:枚举每个点,假设去掉该点,然后对图求割点后连通分量数,更新最大的即可。算法相对简单,但是注意几个细节: 1:原图可能不连通。 2:有的连通分量只有一个点,当舍去该点时候,连通分量-1; 复习求割点的好题! #include #include #include using namespace std; i...
分类:其他好文   时间:2014-05-23 07:56:52    阅读次数:317
poj 3977 Subset 枚举+二分
首先分成一半2^17和2^18,并且把其中一半变成相反数,然后枚举一半二分查找另一半,在找到的位置前后也找找。 这里用到了二级排序,有很多细节要处理,不多说了。 巨坑的一个地方就是,不能用系统的abs,要自己手写,简直坑死。。 #include #include #include #include using namespace std; typedef long long ...
分类:其他好文   时间:2014-05-22 12:01:31    阅读次数:220
linux内核中驱动开发常见的类似多态
#include #include struct test { char name[20]; void (*func)(char *); }; void tttfunc(char *name) { printf("current is %d\n",__LINE__); printf("%s\n",name); } int main() { struct test ttt= { .n...
分类:系统相关   时间:2014-05-22 11:25:09    阅读次数:380
c语言学习之结构篇代码示例-输入n个同学的姓名,数学英语成绩,按照平均分从低到高排序并输出
#include void main(){ const int count = 5;//定义数量 struct student{ char name[80]; float math,eng; float aver; }stu[count],temp; //输入 for (int i = 0; i scanf("%s%f%f", stu[i].name, &stu[i].m...
分类:编程语言   时间:2014-05-22 11:21:15    阅读次数:312
uva 10253 - Series-Parallel Networks
题目链接:uva 10253 - Series-Parallel Networks 题目大意:就是有n条线,通过并联或者是串联,形成一个整体,问说有n条线,可以组成多少种。 解题思路:大白书上的例题,解法还真是高端.dp[i][j]表示说每个树德叶子节点不大于i,一共有j个叶子。f[i]=dp[i-1][i],注意n为1的时候。 #include #include typede...
分类:Web程序   时间:2014-05-22 11:03:40    阅读次数:402
假定有20个 有序 数组,每个数组有500个数字,数字类型32位uint数值,现在需要取出这10000个数字中最大的500个,怎么做?
//3、假定有20个  有序   数组,每个数组有500个数字,数字类型32位uint数值,现在需要取出这10000个数字中最大的500个,怎么做? #include using namespace std; struct node { int data; int next; }; node obj[20]; void sift(int k,int m,int ...
分类:其他好文   时间:2014-05-22 10:54:48    阅读次数:292
c语言中指针悬空
指针悬空 指针悬空在我们使用指针的时候很容易被忽视,主要的表现是:指针所指向的内存 释放,指针并没有置为NULL,致使一个不可控制的指针。 #include #include int *pointer; void func() { int n=8; pointer=&n; printf("pointer point data is %d\n",...
分类:编程语言   时间:2014-05-22 09:03:09    阅读次数:371
二叉树的二叉链表存储
节点形态: 实现: /****************************************** 二叉树的二叉链表存储 by Rowandjj 2014/5/18 ******************************************/ #include using namespace std; /*二叉树的二叉链表存储表示*/ typedef int T...
分类:其他好文   时间:2014-05-22 07:03:21    阅读次数:229
各种排序算法的一个类
#include #define MAX 100 using namespace std; class Sample {      int a[MAX];       int b[MAX];      int n;      friend class Process;    public:          Sample(){n=0;} }; cla...
分类:其他好文   时间:2014-05-20 15:24:05    阅读次数:345
UVA 12123 - Magnetic Train Tracks(计数问题)
题目链接:12123 - Magnetic Train Tracks 题意:给定n个点,求有几个锐角三角形。 思路:和UVA 11529是同类的题,枚举一个做原点,然后剩下点根据这个原点进行极角排序,然后利用two pointer去遍历一遍,找出角度小于90度的锐角,然后扣掉这些得到钝角三角形的个数,然后在用总情况去扣掉钝角就是锐角或直角 代码: #include #include #...
分类:Web程序   时间:2014-05-20 14:10:56    阅读次数:412
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!