摘要: 一只小蜜蜂...Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30097 Accepted Submission(s): 11106Problem Description有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。其中,蜂房的结构如下所示。 Input输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0 6 using name... 阅读全文
posted @ 2013-08-13 12:02 Freecode# 阅读(720) 评论(0) 推荐(0) 编辑
摘要: 超级楼梯Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23642 Accepted Submission(s): 12153Problem Description有一楼梯共M级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第M级,共有多少种走法? Input输入数据首先包含一个整数N,表示测试实例的个数,然后是N行数据,每行包含一个整数M(1 6 using namespace std; 7 8 /* 用普通递归会超... 阅读全文
posted @ 2013-08-13 10:32 Freecode# 阅读(886) 评论(0) 推荐(0) 编辑
摘要: 概况:递归和分治递归中用到了分治法。分治法的思想简单概括就是“分而治之”。递归实际使用“栈”来实现的。递归包括递归方程、临界条件:EX:实现随机斐波那契数列?汉诺塔?八皇后-->N皇后?时间复杂度:递归时间复杂度是很大的。 So可以用记忆递归法:牺牲空间,换取时间。(办法:放到数组里,数组空间浪费大,但读取快) Ex:HDU 2041 超级楼梯、HDU 2044 一只小蜜蜂...综上,做递归的题,要先分析,再总结出递归方程。 Ex:HDU 2050折线分割平面(标准递归题)二分搜索(大整数的乘法、矩阵乘法(棋盘覆盖))合并排序快速排序树树的分支最多有2个。又叫孩子数。结点的左孩子,... 阅读全文
posted @ 2013-08-08 20:43 Freecode# 阅读(468) 评论(0) 推荐(0) 编辑
摘要: 注:以下内容摘自http://blog.csdn.net/byxdaz/article/details/4633826STL六大组件容器(Container)算法(Algorithm)迭代器(Iterator)仿函数(Function object)适配器(Adaptor)空间配置器(allocator)1、容器作为STL的最主要组成部分--容器,分为向量(vector),双端队列(deque),表(list),队列(queue),堆栈(stack),集合(set),多重集合(multiset),映射(map),多重映射(multimap)。容器特性所在头文件向量vector可以用常数时间访问 阅读全文
posted @ 2013-08-06 12:06 Freecode# 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 数据结构——栈和队列 目录:栈 --- 基础知识栈 --- 练习题队列 --- 基础知识栈: 栈示意图(后进先出):顺序栈:顺序栈结构定义:#define MAXSIZE 1024struct Stack{ ElemType data[MAXSIZE]; int top;};操作函数:push(); //入栈pop(); //出栈……….链栈:struct Lstack{ //链栈 ElemType data; Lstack* next;};链栈示意图:操作函数:push(); //入栈pop(); //出栈……….注意:也可以直接调... 阅读全文
posted @ 2013-08-05 15:38 Freecode# 阅读(471) 评论(0) 推荐(0) 编辑
摘要: freopen()——重定向标准输入输出流 头文件:stdio.h 函数原型:FILE * freopen(const char *filename , const char *type , FILE *stream); 例:freopen(“in.txt”,”r”,stdin);freopen(“out.txt”,”w”,stdout); 参数说明: filename: 文件名,用于存储输入输出的自定义文件名。例:"debug\\in.txt" ,可以是路径。 type: 文件打开的模式。和fopen中的模式(如r-只读, w-写)相同。 stream: ... 阅读全文
posted @ 2013-08-04 13:26 Freecode# 阅读(3776) 评论(0) 推荐(0) 编辑
摘要: 来自互联网的各种优秀的资源,我会放在这里,略作整理和归类,供大家分享。 我相信滴水也能汇成江河。文章:让电脑更高效的魔法 - 浅谈高效率PC工作环境的简化、净化与建立方法 (上) ---来自异次元软件:http://www.iplaysoft.com/build-effective-working-environment-1.html让电脑更高效的魔法 – 浅谈高效率PC工作环境的简化、净化与建立方法 (下) --- 来自异次元软件:http://www.iplaysoft.com/build-effective-working-environment-2.html大学毕业生在找工作之前... 阅读全文
posted @ 2013-08-03 15:32 Freecode# 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Problem A: Jolly JumpersTime Limit:1 SecMemory Limit:64 MBSubmit:10Solved:4[Submit][Status][Web Board]DescriptionA sequence of n > 0 integers is called a jolly jumper if the absolute values of the differences between successive elements take on all possible values 1 through n - 1. For instance, 1 阅读全文
posted @ 2013-08-02 11:28 Freecode# 阅读(229) 评论(0) 推荐(0) 编辑
摘要: Problem G: Check The CheckTime Limit:1 SecMemory Limit:64 MBSubmit:10Solved:3[Submit][Status][Web Board]DescriptionYour task is to write a program that reads a chessboard configuration and identifies whether a king is under attack (in check). A king is in check if it is on square which can be taken 阅读全文
posted @ 2013-08-02 09:49 Freecode# 阅读(362) 评论(0) 推荐(0) 编辑
摘要: Problem C: The TripTime Limit: 1 SecMemory Limit: 64 MBSubmit: 19Solved: 3[Submit][Status][Web Board]DescriptionThe Trip A group of students are members of a club that travels annually to different locations. Their destinations in the past have included Indianapolis, Phoenix, Nashville, Philadelphia 阅读全文
posted @ 2013-07-31 09:16 Freecode# 阅读(449) 评论(0) 推荐(0) 编辑