码迷,mamicode.com
首页 >  
搜索关键字:algorithm    ( 11758个结果)
hdu 2072 单词数(STL set写法)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2072 思路简单,但是注意一个细节就是最后可能是空格结束的,就是这儿让我WA啦好多次呀。。。 code: #include #include #include #include #include #include #include using namespace std; int...
分类:其他好文   时间:2014-09-22 22:51:43    阅读次数:184
divide-conquer-combine(4.1 from the introduction to algorithm)
this example is from chapter 4 in 《the introduction to algorithm》the main idea is all showed in the book , i think maybe realizing the algorithm is a ...
分类:其他好文   时间:2014-09-22 22:40:33    阅读次数:173
【LeetCode】Sum Root to Leaf Numbers 解题报告
【题目】 Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Fin...
分类:其他好文   时间:2014-09-22 19:30:53    阅读次数:175
hdoj 5037 Frog 【万恶的贪心】
题目:hdoj 5037 Frog 题意:一直聪明的青蛙,每次能条 l 的长度,河宽为m,喝中心有一些陆地,它会选择尽量少的次数跳,现在上帝可以任意往喝里面放陆地(视为点),让青蛙跳的次数最多,求最大次数? 分析:1:首先如果加入大于(l+1)的距离,那么上帝会给他分成(l+1)的段,因为我给他(l+1),它一下子跳不过去,必然中间还要一个点,让青蛙跳,这样肯定步数最大。(贪心...
分类:其他好文   时间:2014-09-22 19:26:53    阅读次数:171
STL algorithm算法pop_heap,push_heap(45)
pop_heap原型: std::pop_heap default (1) template void pop_heap (RandomAccessIterator first, RandomAccessIterator last); custom (2) template void pop_heap (RandomAcc...
分类:其他好文   时间:2014-09-22 19:25:23    阅读次数:183
STL algorithm算法partition_point,stable_partition(44)
partition_point原型: std::partition_point template ForwardIterator partition_point (ForwardIterator first, ForwardIterator last, UnaryPredicate pred); 该函...
分类:其他好文   时间:2014-09-22 18:41:03    阅读次数:118
STL algorithm算法partial_sort,partial_sort_copy(42)
partial_sort原型: std::partial_sort default (1) template void partial_sort (RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last)...
分类:其他好文   时间:2014-09-22 17:38:32    阅读次数:298
STL algorithm算法partition, partition_copy(43)
partition原型: td::partition C++98 C++11 template ForwardIterator partition (ForwardIterator first, ForwardIterator last, UnaryPredicate pred); ...
分类:其他好文   时间:2014-09-22 17:17:23    阅读次数:170
MD5加密算法简单示例
MD5加密算法简单示例         现在网络上一般的网站,只要功能稍微完善一点的,都需要用户进行注册,提供诸如用户名、用户密码、电子邮件、甚至是电话号码、详细住址等个人隐私信息,然后才可以 享受网站提供的一些特殊的信息或者服务。为了增加安全性,有必要对数据库中的隐私数据进行加密。         MD5算法,即“Message-Digest Algorithm 5(信息-摘要算法)”...
分类:其他好文   时间:2014-09-22 16:28:42    阅读次数:184
Algorithm Part I:ELEMENTARY SORTS
1.选择排序的实现 2.插入排序的实现 3.shell排序的实现     注意代码中h值的选取。 4.shuffling(随机算法) 问题描述:给定一组元素个数为N数组i,随机的重新安排每个元素的位置,要求每个元素出现在各个位置上的概率相等。 解(1): 思路:声明一个长度为N的double类型的数组j,生成N个随机变量依次赋给j中的元...
分类:其他好文   时间:2014-09-22 15:38:22    阅读次数:148
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!