2017年9月19日

图论 关键路径

摘要: 测试所用的AOE图如下:算法参考#include#include#include#include#include#includeusing namespace std;int stack2[100],top2;int etv[100],ltv[100];typedef struct NODE{int... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(220) 评论(0) 推荐(0)

DP入门 最佳加法表达式

摘要: 描述给定n个1到9的数字,要求在数字之间摆放m个加号(加号两边必须有数字),使得所得到的加法表达式的值最小,并输出该值。例如,在1234中摆放1个加号,最好的摆法就是12+34,和为36输入有不超过15组数据每组数据两行。第一行是整数m,表示有m个加号要放( 0#include\#include#i... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(236) 评论(0) 推荐(0)

数据结构 斐波那契查找

摘要: #include#include#include#include#includeusing namespace std;int f[1005];void init(){ int i,j; f[0]=0; f[1]=1; for(i=2; if[k]-1)k++;//这里执行完... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(144) 评论(0) 推荐(0)

使用函数查找字符串子串

摘要: 转载自 大佬1. 考虑用标准函数库中 strstr() 函数包含文件:string.h函数名: strstr函数原型:extern char *strstr(char *str1, char *str2);功能:从字符串str1中查找是否有字符串str2,如果有,从str1中的str2位置起,返... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(973) 评论(0) 推荐(0)

平衡二叉树

摘要: 平衡二叉树这里停留了很久,费了很大功夫才弄懂。做个笔记比较好。参考以下两位大佬的博客写的:1: http://www.cnblogs.com/fornever/archive/2011/11/15/2249492.html2: http://blog.csdn.net/followmyinc... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(117) 评论(0) 推荐(0)

HDU 4277 dfs+set去重

摘要: USACO ORZTime Limit: 5000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5547 Accepted Submission(s): 1840P... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(94) 评论(0) 推荐(0)

数据结构之链式线性表

摘要: 带头结点的#include#include#include#include#include#includeusing namespace std;#define OK 1#define ERROR 0typedef int status;typedef struct LNODE{ int da... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(174) 评论(0) 推荐(0)

HDU 1010 dfs+奇偶剪枝

摘要: dfs+剪枝Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 129536 Accepted Su... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(98) 评论(0) 推荐(0)

数据结构之顺序线性表

摘要: 九层之台起于垒土,千里之行始于足下!数据结构 顺序线性表这个要注意的地方就是线性表中元素编号是从1开始的,但实际储存时却是用相当于数组的方式储存的,元素从0开始储存故可以边画图边理解,下图标上“(reason)”的地方均是这个原因#include#include#include#include#i... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(83) 评论(0) 推荐(0)

POJ 1753 dfs+枚举

摘要: Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 46805 Accepted: 20034DescriptionFlip game is played on a rectangular 4x4 field with... 阅读全文

posted @ 2017-09-19 23:08 横济沧海 阅读(211) 评论(1) 推荐(0)

导航