码迷,mamicode.com
首页 >  
搜索关键字:using    ( 53562个结果
poj 2945 Find the Clones trie树的简单应用
题意: 给n个长m的字符串,统计他们的出现频率,输出出现1次的有几种,出现2次的有几种...出现n次的有几种。n 分析: 也可以用排序,map水的,但还是写个trie树也不麻烦,trie树我就得就是针对字符串的hash表,效率如果数据大点是比暴力解法高很多的,另外写的时候不小心把index定义成char,n 代码: //poj 2945 //sep9 #include using na...
分类:其他好文   时间:2015-07-05 15:08:33    阅读次数:166
单行dp复习hdu1087
我写的想法是每一个dp【i】都是前dp【i】的最大值 dp【i】就等于前所有dp【0。。。i-1】的最大值加上dp【i】 最大值是一个中间变量 最大值得选取条件就是序列的值大小都是递增的,也就是a[i]>a[前面的] #include #include #include using namespace std; typedef long long LL; LL a[1000+100]; L...
分类:其他好文   时间:2015-07-05 13:47:03    阅读次数:92
C语言学生信息管理系统
//原创:!! 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int n; 7 8 struct student 9 { 10 char name[20] ; ...
分类:编程语言   时间:2015-07-05 13:42:26    阅读次数:125
错误代码: 1045 Access denied for user 'skyusers'@'%' (using password: YES)
1. 错误描述GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY ".";1 queries executed, 0 success, 1 errors, 0 warnings查询:grant all privileges on *.* to root@"%" identified by "."错误代码: 1045 Access denied...
分类:数据库   时间:2015-07-05 12:31:38    阅读次数:205
超级台阶
描述 有一楼梯共m级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第m级,共有多少走法? 注:规定从一级到一级有0种走法。 输入输入数据首先包含一个整数n(1 输出对于每个测试实例,请输出不同走法的数量。 样例输入 2 2 3 样例输出 1 2 来源[苗栋栋]原创 上传者苗栋栋 #include #include using namespace...
分类:其他好文   时间:2015-07-05 12:26:35    阅读次数:97
卡片游戏
桌上有一叠牌,从第一张牌(即位于顶面的牌)开始从上往下依次编号为1~n。当至少还剩两张牌时进行以下操作:把第一张牌扔掉,然后把新的第一张放到整叠牌的最后。输入n,输出每次扔掉的牌,以及最后剩下的牌。 输入:7 输出: 1 3 5 7 4 2 6  #include #include using namespace std; queue q; int main() { int n; sc...
分类:其他好文   时间:2015-07-05 12:26:14    阅读次数:126
State状态机模式
#include using namespace std;class Contex; //即使此处声明了,如果类中调用的有Contex函数, //那么编译器也会找不到定义的地方,所有这里我将 //所有的类的实现都延迟在外面,这样对于每一个类而言, //其他的类都是可见的,最大的好处就是类之间的相互调用 //不会产生什么未定义类型的错误警告。 class Base { publi...
分类:其他好文   时间:2015-07-05 11:08:09    阅读次数:107
poj 2955 Brackets dp简单题
//poj 2955 //sep9 #include using namespace std; char s[128]; int dp[128][128]; int n; int rec(int l,int r) { if(dp[l][r]!=-1) return dp[l][r]; if(l==r) return dp[l][r]=0; if(l+1==r){ if(s[l...
分类:其他好文   时间:2015-07-05 11:03:51    阅读次数:104
ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user'
ERROR: Access denied for user 'root'@'localhost' (using password: NO) 发现: mysql -u root@localhost -p 成功 mysql -u root -p 失败 mysql> SELECT user, host F...
分类:其他好文   时间:2015-07-05 10:58:25    阅读次数:295
对容器元素重新排序的算法
假设我们要分析一组儿童故事中使用的单词,例如想知道他们使用了多少个6个或者以上字母组成的单词。每个单词只统计一次,不考虑它出现的次数。 程序代码如下: #include #include #include #include using namespace std; //comparison function to be userd to sort by word length bool...
分类:编程语言   时间:2015-07-05 09:43:39    阅读次数:165
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!