会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Sadboy
要走得快,就一个人走;要走得远,就一起走。·I treasure every one of my life!·
上一页
1
2
3
4
5
6
下一页
2012年11月17日
谷歌面试题续篇之天下英雄令:15题等你答!
摘要: 转载自:http://news.cnblogs.com/n/164019/
阅读全文
posted @ 2012-11-17 20:18 Raining Days
阅读(142)
评论(0)
推荐(0)
2012年11月12日
hdu 1251 统计难题
摘要: 汉语提,题意清楚。当初还卡了我一个上午。哎。ac代码:View Code #include <algorithm>#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>#include <string>#include <set>using namespace std;const int maxn=26;struct node{ int cnt; node *next[maxn]; node() { cnt=0; for(
阅读全文
posted @ 2012-11-12 16:44 Raining Days
阅读(165)
评论(0)
推荐(0)
hdu 1247 Hat’s Words
摘要: 字典树的题是我一个月前做的了,到现在依然记得,他是我ac的第一个字典树题目。嘻嘻。ac代码:View Code #include <algorithm>#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <string>#include <set>using namespace std;const int maxn=26;const int maxlen=100;char ss1[50005][maxl
阅读全文
posted @ 2012-11-12 16:41 Raining Days
阅读(171)
评论(0)
推荐(0)
hdu 1671 Phone List
摘要: 这题的题解随处可见。仅供参考。ac代码:View Code #include <algorithm>#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>#include <string>#include <set>using namespace std;const int maxn=10;const int maxlen=11;typedef struct TrieNode{ int flg; struct TrieNo
阅读全文
posted @ 2012-11-12 16:39 Raining Days
阅读(153)
评论(0)
推荐(0)
hdu 1075 What Are You Talking About
摘要: 类似hash的题吧,翻译文稿。字典树搞的。ac代码:View Code #include <algorithm>#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>#include <string>#include <set>using namespace std;const int maxn=26;const int maxlen=3001;string tt,sss;struct node{ bool flg; st
阅读全文
posted @ 2012-11-12 16:37 Raining Days
阅读(178)
评论(0)
推荐(0)
hdu 1358 Period
摘要: 这个题是一个好题,题意比较简单,我就不赘述了。能让你对kmp的认识更近一步吧。我以前对kmp的理解仅限于动态规划或者前后缀之类的层次上。自己浅薄。ac代码:View Code #include <algorithm>#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;const int maxn=1000000+5;char s[maxn];int n,next[maxn],ncas;void init(
阅读全文
posted @ 2012-11-12 16:29 Raining Days
阅读(175)
评论(0)
推荐(0)
hdu 2203 亲和串
摘要: 这题大概是数据比较水吧,我本以为会wa或者什么的,没想到直接亮了。讨论版里面神代码多的是,但是我也想把我的代码贴出来:ac代码:View Code #include <algorithm>#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;const int maxn=100000+5;char s1[maxn],s2[maxn];int len1,len2,next[maxn];void get_nex
阅读全文
posted @ 2012-11-12 16:17 Raining Days
阅读(159)
评论(0)
推荐(0)
hdu 3068 最长回文
摘要: 此题就是传说中的nlogn都不可过的那题吧。网上有O(n)的解法,具体的我就不说了。代码也不贴了。我也是从人家那里学过来的。
阅读全文
posted @ 2012-11-12 16:12 Raining Days
阅读(121)
评论(0)
推荐(0)
hdu 1711 Number Sequence
摘要: 这个更是比较简单,就是找一个串在另一个串是否有出现,如果没有出现,输出-1,如果出现了,输出index,如果出现多次,输出最小的那个index。下面是我的代码:ac代码:View Code #include <algorithm>#include <iostream>#include <stdlib.h>#include <string.h>#include <limits.h>#include <stdio.h>#include <math.h>#include <vector>#include
阅读全文
posted @ 2012-11-12 16:07 Raining Days
阅读(137)
评论(0)
推荐(0)
hdu 2594 Simpsons’ Hidden Talents
摘要: kmp,题意是找一个字符串既是s1串的前缀同时又是s2后缀,并且要这个字符串的长度最大。思路是把s2串当成是文本串,s1串当成是模式串,两个串KMP。具体的见代码。呵呵。ac代码:View Code #include <algorithm>#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;const int maxn=50000+5;char s1[maxn],s2[maxn];int n,len1,l
阅读全文
posted @ 2012-11-12 16:01 Raining Days
阅读(191)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
下一页
公告
导航
博客园
首页
新随笔
联系
订阅
管理