码迷,mamicode.com
首页 >  
搜索关键字:using password: yes    ( 53562个结果
hdu 4587 2013南京邀请赛B题/ / 求割点后连通分量数变形。
题意:求一个无向图的,去掉两个不同的点后最多有几个连通分量。  思路:枚举每个点,假设去掉该点,然后对图求割点后连通分量数,更新最大的即可。算法相对简单,但是注意几个细节: 1:原图可能不连通。 2:有的连通分量只有一个点,当舍去该点时候,连通分量-1; 复习求割点的好题! #include #include #include using namespace std; i...
分类:其他好文   时间:2014-05-23 07:56:52    阅读次数:317
C#用SerialPort实现串口通讯
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Tex...
分类:其他好文   时间:2014-05-22 12:36:05    阅读次数:243
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
假定有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
POJ 3070 Fibonacci
Sol:就是求第N项的斐波那契数。矩阵乘法+快速幂 #include #include #include #include using namespace std; #define LL long long struct Mat{ LL f[2][2]; }; LL MOD = 10000; Mat mul(Mat a,Mat b) { LL i,j,k...
分类:其他好文   时间:2014-05-22 10:46:35    阅读次数:191
C++ 写文件操作
//编写一个程序,让用户可以一次性输入任意多行文本 /*  * OutPutTest.cpp  *  *  Created on: 2014年5月19日  *      Author: John  */ #include #include #include #define COL_WIDTH 80 using namespace std; int main(){ ofstrea...
分类:编程语言   时间:2014-05-22 10:42:34    阅读次数:350
二叉树的二叉链表存储
节点形态: 实现: /****************************************** 二叉树的二叉链表存储 by Rowandjj 2014/5/18 ******************************************/ #include using namespace std; /*二叉树的二叉链表存储表示*/ typedef int T...
分类:其他好文   时间:2014-05-22 07:03:21    阅读次数:229
jQuery -> 获取指定上下文中的DOM元素
jQuery函数的第二个参数可以指定DOM元素的搜索范围。 第二个参数可分为以下类型 DOM referencejQuery wrapperdocument 代码示例 // search within all form elements, using a wrapper for context, // alerts "8...
分类:Web程序   时间:2014-05-20 16:32:25    阅读次数:377
各种排序算法的一个类
#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
c++学习笔记4,派生类的构造函数与析构函数的调用顺序(一)
测试源码: //测试派生类的构造函数的调用顺序何时调用 //Fedora20 gcc version=4.8.2 #include using namespace std; class base { public: base() { cout<<"base created!"<<endl; } ~base() { cout<<"base destroyed!"<<en...
分类:编程语言   时间:2014-05-20 14:12:21    阅读次数:322
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!