码迷,mamicode.com
首页 >  
搜索关键字:1446. sorting hat    ( 5284个结果
排序算法Java实现(基数排序)
1 package sorting; 2 3 /** 4 * 基数排序 5 * 平均O(d(n+r)),最好O(d(n+r)),最坏O(d(n+r));空间复杂度O(n+r);稳定;较复杂 6 * d为位数,r为分配后链表的个数 7 * @author zeng 8 * 9 */10...
分类:编程语言   时间:2015-04-25 22:36:40    阅读次数:226
排序算法Java实现(堆排序)
1 package sorting; 2 3 /** 4 * 堆排序 5 * 平均O(nlogn),最好O(nlogn),最坏O(nlogn);空间复杂度O(1);不稳定;较复杂 6 * @author zeng 7 * 8 */ 9 public class DuiPaixu {10...
分类:编程语言   时间:2015-04-25 22:32:39    阅读次数:199
排序算法Java实现(快速排序)
1 package sorting; 2 3 /** 4 * 快速排序 5 * 平均O(nlogn),最好O(nlogn),最坏O(n^2);空间复杂度O(nlogn);不稳定;较复杂 6 * @author zeng 7 * 8 */ 9 public class Kuaisupai...
分类:编程语言   时间:2015-04-25 22:29:42    阅读次数:294
排序算法Java实现(选择排序)
1 package sorting; 2 3 /** 4 * 选择排序 5 * 平均O(n^2),最好O(n^2),最坏O(n^2);空间复杂度O(1);不稳定;简单 6 * @author zeng 7 * 8 */ 9 public class XuanzePaixu {10 11...
分类:编程语言   时间:2015-04-25 22:25:41    阅读次数:199
nyoj349 poj1094 Sorting It All Out(拓扑排序)
题目大意输入n,m。 一共有n个字母(从A开始), m行语句每个语句“x﹤y”,说明x,y之间的偏序关系。让你判断是否可以通过这些关系得到一个唯一的升序序列,若能则输出这个序列并指出通过前多少条语句得出的,如果n个字母间存在矛盾,输出相应语句并指出那条语句开始出现矛盾的。如果没有唯...
分类:编程语言   时间:2015-04-24 09:06:12    阅读次数:178
nyoj349 poj1094 Sorting It All Out(拓扑排序)
nyoj349 http://acm.nyist.net/JudgeOnline/problem.php?pid=349poj1094 http://poj.org/problem?id=1094这两个题是一样的,不过在poj上A了才算真的过,ny上数据有一点弱。题目大意输入n,m。 一共有n个字母...
分类:编程语言   时间:2015-04-24 00:53:08    阅读次数:297
hdu1247 Hat’s Words
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1247 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 char p[50005]...
分类:其他好文   时间:2015-04-23 15:05:37    阅读次数:198
poj3270 Cow Sorting
置换群的第二题,一开始总是tle,后来一思考,置换根本不是这个情况,置换是一种排列,就用了几个数组将输入的数进行操作,最后A了,对置换有一些了解了。 #include #include #include using namespace std; const int maxn = 10000+10; int n,least; int a[maxn],b[1000010],s[maxn],tmp[1...
分类:其他好文   时间:2015-04-23 00:07:04    阅读次数:158
POJ1094 Sorting It All Out(拓扑排序)每输入条关系判断一次
Sorting It All Out Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 29182   Accepted: 10109 Description An ascending sorted sequence of distinct values is one...
分类:编程语言   时间:2015-04-22 15:19:59    阅读次数:174
HDU1247 Hat’s Words【字典树】
题目大意: 一个"hat's word"是一个单词,可以恰好由字典中其他两个单词连接得到(比如字典中是hat's和word)。 给出字典中的单词,输出所有的hat's word。 思路: 建立字典树,将每个单词都插入到Trie树中,Count统计单词(不是前缀)出现次数。按顺序将每个单词 所有可能的长度拆分成前缀单词和后缀单词,判断这两部分是否都在字典树中,是就是hat's word, 进行输出,否则继续拆分当前单词或下一单词。...
分类:其他好文   时间:2015-04-22 14:01:55    阅读次数:124
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!