poj 1035 Spell checker(暴力判断)...
分类:
其他好文 时间:
2014-09-05 16:16:12
阅读次数:
174
递推。设n个盒子的Spell次数为S(n),期望为E(n)。当有n个盒子时,可能第n把钥匙在第n个盒子中,此时的Spell次数应该为(n-1)!+S(n-1);当第n把钥匙不在第n个盒子中,混合排列,此时的Spell次数为(n-1)*S(n-1),因此,期望E(n) = S(n)/n!,S(n) =...
分类:
其他好文 时间:
2014-08-31 22:37:21
阅读次数:
190
Spell checkerTime Limit: 2000 MS Memory Limit: 65536 KB64-bit integer IO format: %I64d , %I64u Java class name: Main[Submit] [Status] [Discuss]Descrip...
分类:
其他好文 时间:
2014-08-31 14:23:21
阅读次数:
175
DescriptionBusinesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or p...
分类:
其他好文 时间:
2014-08-22 00:19:05
阅读次数:
195
题目 Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University of Wa...
分类:
其他好文 时间:
2014-08-21 15:22:24
阅读次数:
237
Problem Description
Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the U...
分类:
其他好文 时间:
2014-08-16 16:28:10
阅读次数:
185
487-3279
Businesses like to have memorable telephone numbers. One way to make a telephone number memorableis to have it spell a memorable word or phrase. For example, yo...
分类:
其他好文 时间:
2014-08-04 21:41:34
阅读次数:
395
被这样的题目忽悠了,一开始以为使用Trie会大大加速程序的,没想到,一不小心居然使用Trie会超时。
最后反复试验,加点优化,终于使用Trie是可以过的,不过时间大概难高于1500ms,一不小心就会超时。
看来这是一道专门卡Trie的题目,只好放弃不使用Trie了。
也得出点经验,如果字符串很多,如本题有1万个字符串的,那么还是不要使用Trie吧,否则遍历一次这样的Trie是十分耗时的,2s...
分类:
其他好文 时间:
2014-08-02 15:30:03
阅读次数:
245
Spell checker
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 19044
Accepted: 6959
Description
You, as a member of a development team for a new spell check...
分类:
其他好文 时间:
2014-08-02 13:00:53
阅读次数:
262
#include#include#includechar *g_WordTable[10]= {"zero", "one", "two", "three", "four", "five","six", "seven", "eight", "nine"};int main(){ //存放用户输入...
分类:
其他好文 时间:
2014-08-02 12:31:53
阅读次数:
530