自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(23)
  • 资源 (2)
  • 收藏
  • 关注

原创 Ubuntu vim配置文件

Ubuntu vim配置文件 附说明 收藏<br />安装Ubuntu8.04beta版后,我的vim变得“无精打采”了,主要是没有在配置文件中设置属性的缘故,我的Ubuntu6.06是david帮我我配置的,超快,我还没看清就弄完了,今天自己试试看吧,于是上网搜索了一下相关内容,来个照猫画虎,试验基本成功!<br /><br />我的vim配置文件位置:<br />/etc/vim/vimrc<br /><br />我增加的内容:<br /><br />"-----------

2010-10-31 00:06:00 1798

原创 笔记 VC++ Lesson1 句柄 / 窗口 / 消息循环 / 回调函数

句柄HANDLE图标句柄HICON光标句柄HCURSOR窗口句柄HWND应用程序实例句柄HINSTANCE//消息队列的消息结构体Thisstructure contains message information from a thread's message queue. typedefstructtagMSG{  HWNDhwnd;//句柄  UINTmessage;//Unsigned Int 以WM_开头的宏作为消息的类型  WPARAMwParam;//整数,指示消息的附加信息  LPA

2010-09-08 09:01:00 1519

原创 C/C++的64位整型 不同编译器间的比较

 //为了和DSP兼容,TSint64和TUint64设置成TSint40和TUint40一样的数  //结果VC中还是认为是32位的,显然不合适  //typedef signed long int     TSint64;  //typedef unsigned long int   TUint64;    //ANSI C中规定long lon

2010-05-05 14:04:00 5963

原创 priority_queue & 结构体||类 & 自定义比较函数cmp

   template                     class Sequence=vector ,                     class Compare=less >  #include #include #include using namespace std;struct node {     int no;     int year;

2010-05-05 12:47:00 6281

原创 limits 头文件使用示例

 ////////////////////////////////////////////////////////////////////// // // Compile options needed: /GX// // : Numeric.cpp// // Variables and Functions:// // has_denor

2010-05-04 17:09:00 1281

原创 Prim 算法, hdu 1102 Constructing Roads

/* * m.cpp * * Created on: 2010-5-3 * Author: Administrator */#include //#include #include #include #include #include #include #include #include using namespace std

2010-05-04 17:01:00 598

原创 计算二进制位'1'的个数

写一个函数,返回数字中二进制位为1的个数。比如36,化为二进制得到100100,其中有2个1。方法1:分别判断各个位int bit_count(unsigned int n){    int count;    for(count = 0; n; n >>= 1)    {        count += n & 1;    }    return count;}方法2:循环中

2010-04-26 19:33:00 681

原创 binarySearch 只有10%程序员能正确实现二分查找算法

#include #include using namespace std;int binary_search(int * num, int begin, int end, int target)//对num[begin, end] 进行二分查找。 找到返回位置, 否则返回-1{ int i = begin; int j = end; int mi

2010-04-23 17:58:00 1104

原创 KMP算法详解 转帖

源地址 : http://blog.youkuaiyun.com/Oneil_Sally/archive/2008/12/03/3440784.aspx   个人觉得这篇文章是网上的介绍有关KMP算法更让人容易理解的文章了,确实说得很“详细”,耐心地把它看完肯定会有所收获的~~,另外有关模式函数值next[i]确实有很多版本啊,在另外一些面向对象的算法描述书中也有失效函数 f(j)的说法,其实是一

2010-04-06 21:12:00 538

原创 PKU 2513 ColorSticks 详细解答

该题 必须使用字典树(Trie Tree) 和 并查集(Disjointset) 和 欧拉通路 、 回路的相关知识来解答。】不懂的同学先看下面的链接, 介绍了字典树、并查集、和欧拉通路回路 的 相关知识, 以及 代码模板。字典树:http://blog.youkuaiyun.com/hongxdong/archive/2010/03/24/5413139.aspx并查集:http://blog.c

2010-03-24 22:00:00 1466 1

原创 PKU 2513 ColorSticks 知识预备(欧拉通路、回路),感谢蔡根同学。

该题的详细解答链接:http://blog.youkuaiyun.com/hongxdong/archive/2010/03/24/5413719.aspx 预备知识:      1,定义:给定图G=,经过G中每条边一次且仅一次的通路(回路),称为欧拉通路(回路),存在欧拉回路的图称为欧拉图。      2,定理:非平凡无向图G=中存在欧拉通路当且仅当G是连通的,且有零个或两个奇度数顶点。    

2010-03-24 21:59:00 921

原创 Disjointset 并查集(按秩合并,与路径压缩)的模板

并查集介绍 USACO 翻译:http://www.nocow.cn/index.php/%E5%B9%B6%E6%9F%A5%E9%9B%86 http://www.nocow.cn/index.php/Code:Disjointset_c%2B%2B  #include using namespace std;int const MAXNUM = 500001;in

2010-03-24 20:40:00 1446

原创 Trie Tree (字典树)的简单使用 与 模板。

字典树的介绍 wiki 百科。http://zh.wikipedia.org/wiki/%E5%AD%97%E5%85%B8%E6%A0%91  /* Name: Trie Tree Copyright: Author: Green Tsai //蔡根同学写的。 Date: 22/03/10 21:56 Description:*/#incl

2010-03-24 18:41:00 1424 1

原创 usaco 2.1.1 The Castle (使用 FloodFill 方法)

 The CastleIOI94 - Day 1In a stroke of luck almost beyond imagination, Farmer John was sent a ticket to the Irish Sweepstakes (really a lottery) for his birthday. This ticket turned out to have o

2010-03-19 22:19:00 806

原创 hdu 1548 A strange lift BFS 解法

  //不用STL 写的BFS, 要用head 和 tail 标记 step 、 layer 数组。// step 用来记录BFS 遍历的所有节点, layer 用来记录节点当前的层数 : layer[tail] = layer[head] + 1。// 在一些要求记录最短路径的题型中, // layer 可以用来记录前驱节点: layer[tail ] = head; //

2010-03-19 17:32:00 955

原创 USACO 1.4.2 BFS 解法。

usaco 1.4.2 BFS/**//* ID: hongxdo1 PROG: clocks LANG: C++*/#include #include #include using namespace std;int const with[10][5] = {{}, {1,2,4,5},{1,2,3},{2,3,5

2010-03-19 17:30:00 1147

原创 pku 2488 A Knight's Journey

因为要遍历全部点, 所以肯定可以从A1 出发。/dfs 一般结构bool dfs(arguments){ if (Search to The End Of DFS)return true; Save Some Arguments; for (every NextNode) { Save Some Next

2010-03-13 22:50:00 662

原创 hdu 1042 N! 大数相乘。

N!Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12267    Accepted Submission(s): 2979Problem DescriptionGiven an integer N(0 ≤ N ≤ 1000

2009-12-01 21:02:00 1352

原创 hdu 2602 Bone Collector (01 背包问题)

Bone CollectorTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2080    Accepted Submission(s): 669Problem DescriptionMany years ago , in Te

2009-12-01 12:55:00 2163

原创 hdu 2601 An easy problem

 An easy problemTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1505    Accepted Submission(s): 302Problem DescriptionWhen Teddy was a c

2009-11-30 10:58:00 1007

原创 hdu 2293 Name PK

  Name PK Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 148    Accepted Submission(s): 75Problem DescriptionName PK is a funny game on

2009-11-30 10:51:00 1443

原创 hdu 2352 Verdis Quo

 Verdis QuoTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 282    Accepted Submission(s): 212Problem DescriptionThe Romans used letters

2009-11-30 10:48:00 1082

原创 hdu 2399 GPA

 GPATime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 317    Accepted Submission(s): 194Problem DescriptionEach course grade is one of the

2009-11-30 10:43:00 1536

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除