摘要: The sum problem 阅读全文
posted @ 2013-08-27 23:39 兰幽 阅读(470) 评论(0) 推荐(0) 编辑
摘要: 约瑟夫问题:有n个人,其编号分别为1,2,3,…,n。这n个人按顺序排成一个圈。现在给定s和d,从第s个人开始从1依次报数,数到d的人出列, 阅读全文
posted @ 2013-08-22 22:07 兰幽 阅读(559) 评论(0) 推荐(0) 编辑
摘要: 链表中的每一个元素都包含一个成为节点的结构,每向链表中增加一个元素,就会产生一个与之相关的节点,每个节点与它相邻的节点相连接,这里教我们写一个自己的MyLinkedList 阅读全文
posted @ 2013-08-22 16:53 兰幽 阅读(493) 评论(0) 推荐(0) 编辑
摘要: 实现线性表的方法有两种: 1、数组(arry),数组是动态的创建的,如果元素超过了数组的容量,就会创建一个新的数组并且把当前的数组元素复制到更大的数组里; 2、连式结构(linked structure)。连式结构有节点构成,节点是动态创建的。 阅读全文
posted @ 2013-08-22 14:46 兰幽 阅读(453) 评论(0) 推荐(0) 编辑
摘要: Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result. This year, they decide to leave this lovely job to you. 阅读全文
posted @ 2013-08-20 15:45 兰幽 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Number Sequence 阅读全文
posted @ 2013-08-19 21:31 兰幽 阅读(669) 评论(0) 推荐(0) 编辑
摘要: equal(s.begin(), s.end(), s.rbegin());回文串 阅读全文
posted @ 2013-08-08 17:21 兰幽 阅读(775) 评论(0) 推荐(0) 编辑
摘要: 这个程序用来查找被称为url(统一资源地)的万维网地址,输入一行包含url的字符串,程序会帮你识别并输出字符串里所包含的全部url。 阅读全文
posted @ 2013-08-08 17:12 兰幽 阅读(551) 评论(0) 推荐(0) 编辑
摘要: 标准库定义了四种关联容器:map是其中之一(另外还有set、multimap、multiset)。map的元素以键-值(key-value),在学了顺序容器之后,再学习关联容器,就比较比较好理解了。 阅读全文
posted @ 2013-08-07 10:44 兰幽 阅读(308) 评论(0) 推荐(0) 编辑
摘要: vector容器是一个模板类,可以存放任何类型的对象,因而可以定义任意多种数据类型。vector对象可以在运行时高效地添加元素,并且vector中元素是连续存储的。 阅读全文
posted @ 2013-08-06 21:58 兰幽 阅读(520) 评论(0) 推荐(0) 编辑