Peck Chen

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2010年11月20日

摘要: 字典树的建立是应该都是一样的下面是我的做法:建立完后, 对每一个单词都进行find_string()判断是否符合, 分别对其分成两半, 用j分隔开(左闭右开);分别find()其子串[0, j+1), [j+1, string_len), 当两子串都找到后,则输出此主串, 然后,break;一个break也让我WA, 因为如果输入为:aa aaa aaaaa, 输出是aaaaa 和 aaaaa两行... 阅读全文
posted @ 2010-11-20 10:56 PeckChen 阅读(317) 评论(0) 推荐(0) 编辑

2010年11月18日

摘要: 暑假做的, 高精度大数贴一下哈哈...Accepted 148K 0MS C 2729B 2010-11-18 21:54:09代码DescriptionProblems involving the computation of exact values of very large magnitudeand precision are common. For example, the comput... 阅读全文
posted @ 2010-11-18 21:59 PeckChen 阅读(332) 评论(0) 推荐(0) 编辑

摘要: 感觉跟HDU1251统计难题没什么区别, 但少考虑了一种情况也让我郁闷了如:911 9115654这两个串是不符合情况的还是就是 9115654 和 911也是不合法的(唉...)记得要释放内存! 因为有多组测试数据, 不同于HDU1251的统计难题只有一组数据...2010-11-18 20:53:01 Accepted 1671 312MS 3264K 2419 B C Y代码 阅读全文
posted @ 2010-11-18 21:01 PeckChen 阅读(297) 评论(0) 推荐(0) 编辑

2010年11月17日

摘要: Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每... 阅读全文
posted @ 2010-11-17 14:23 PeckChen 阅读(3308) 评论(0) 推荐(0) 编辑

2010年11月16日

摘要: 簡單題/*Problem DescriptionA boy named Pirates who wants to develop typing software finds that it’s hard to judge whether a letter is lowercase or uppercase. He searches lots of information about i... 阅读全文
posted @ 2010-11-16 17:48 PeckChen 阅读(244) 评论(0) 推荐(0) 编辑

摘要: 超水题...代码/*We divide the HZNU Campus into N*M grids. As you can see from the picture below, the green grids represent the buidings. Given the size of the HZNU Campus, and the color of each grid, you sh... 阅读全文
posted @ 2010-11-16 16:46 PeckChen 阅读(474) 评论(0) 推荐(0) 编辑

摘要: /******************************************************************************* 建立魔方阵魔方阵中各个数的排列规律所示:(1)将1放在第一行中间的一列(2)从2开始直到n*n为止,各数依次按照下列规则存放:每一个数字存放的行比前一个的行数减一, 列数加一;(3)如果上一个数的行数为1, 则下一个数的行数为n(即最下一... 阅读全文
posted @ 2010-11-16 13:51 PeckChen 阅读(327) 评论(0) 推荐(0) 编辑

摘要: 代码 阅读全文
posted @ 2010-11-16 09:51 PeckChen 阅读(3202) 评论(0) 推荐(0) 编辑

2010年11月15日

摘要: /*Problem Description读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 Input测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔。没有非法表达式。当一行中只有0时输入结束,相应的结果不要输出。Output对每个测试用例输出1行,即该表达式的值,精确到小数点后2位。Sample Input1 + ... 阅读全文
posted @ 2010-11-15 20:36 PeckChen 阅读(921) 评论(0) 推荐(1) 编辑

2010年11月3日

摘要: 代码 阅读全文
posted @ 2010-11-03 19:35 PeckChen 阅读(1006) 评论(0) 推荐(0) 编辑