- 博客(49)
- 资源 (3)
- 收藏
- 关注
原创 UVA 10106 Product (大数相乘)
大数相乘。很久之前写过大数相加的代码,很繁琐,当时想着大数相乘其实和大数相加差不多,于是乎就略过了。。可是当你真的写的时候才会注意到出现的问题,就比如前置0的问题忽略了。还有以后注意写的代码格式,还有注释。。。这次又没有写!!唉。。懒!
2014-07-30 17:44:01 975
转载 lcs问题
首先将要看到如何运用动态编程查找两个 DNA 序列的最长公共子序列(longest common subsequence,LCS)。发现了新的基因序列的生物学家通常想知道该基因序列与其他哪个序列最相似。查找 LCS 是计算两个序列相似程度的一种方法:LCS 越长,两个序列越相似。子序列中的字符与子字符串中的字符不同,它们不需要是连续的。例如,ACE 是 ABCDE 的子序列,但不是它的子字
2014-07-30 09:23:21 905
原创 POJ 1988 Cube Stacking
Cube StackingTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 18820 Accepted: 6530Case Time Limit: 1000MSDescriptionFarmer John and Betsy are pla
2014-07-29 19:34:10 915
原创 POJ 2141 Message Decowding(map)
Message DecowdingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11735 Accepted: 6536DescriptionThe cows are thrilled because they've just learned abo
2014-07-24 14:04:04 849
转载 BF 算法详解
算法c扩展n2优化工具1977年,Robert S.Boyer和J Strother Moore提出了另一种在O(n)时间复杂度内,完成字符串匹配的算法,其在绝大多数场合的性能表现,比KMP算法还要出色,下面我们就来详细了解一下这一出色的单模式匹配算法,在此之前推荐读者读一下我的另一篇文章《KMP算法详解》,对于透彻理解BM算法大有裨益。在讲解Boyer-Moore算法之前,我们还是要
2014-07-24 10:56:41 2839
转载 KMP 算法详解
KMP算法,是由Knuth,Morris,Pratt共同提出的模式匹配算法,其对于任何模式和目标序列,都可以在线性时间内完成匹配查找,而不会发生退化,是一个非常优秀的模式匹配算法。但是相较于其他模式匹配算法,该算法晦涩难懂,第一次接触该算法的读者往往会看得一头雾水,主要原因是KMP算法在构造跳转表next过程中进行了多个层面的优化和抽象,使得KMP算法进行模式匹配的原理显得不那么直白。本文希望能够
2014-07-24 10:51:12 587
原创 POJ 2192 Zipper
ZipperTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15938 Accepted: 5651DescriptionGiven three strings, you are to determine whether the third strin
2014-07-23 18:11:20 580
原创 POJ 2126 Factoring a Polynomial
Factoring a PolynomialTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 2412 Accepted: 1256DescriptionRecently Georgie has learned about polynomials. A
2014-07-23 14:10:08 815
原创 POJ 1008 Maya Calendar
Maya CalendarTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 65489 Accepted: 20210DescriptionDuring his last sabbatical, professor M. A. Ya made a sur
2014-07-23 12:20:34 739 2
原创 UVA 10008 What's Cryptanalysis?
E -What's Cryptanalysis?Crawling in process...Crawling failedTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmitStatus Description What
2014-07-23 10:39:45 864
原创 POJ 2299 Ultra-QuickSort
#include //由小到大排序using namespace std;int s[500005];int main(){ int i, j; int n; while(cin>>n&&n) { for(i=1;i<=n;i++) cin>>s[i]; int sum=0; int temp; for(i=1;i<n;i++) for
2014-07-22 15:34:06 667
转载 关联容器 map
http://wenku.baidu.com/link?url=Du0M0tk1-XFP0SK8dFYWyY0L_VOG0flXfWl3_5f7rhrjGDbhq6kRQaN4RveqynWpLITdWaokxuYYxbs-kHESdhodhoLgfYCaJIkXVKSkQoq
2014-07-22 09:45:13 1016 1
原创 POJ 2388 Who's in the Middle
Who's in the MiddleTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 31411 Accepted: 18245DescriptionFJ is surveying his herd to find the most average cow
2014-07-22 09:10:12 606
原创 POJ 1363 Rails
B - RailsCrawling in process...Crawling failedTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmitStatus DescriptionThere is a famous railway s
2014-07-21 18:08:49 728 1
原创 POJ 3750 小孩报数问题
小孩报数问题Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9913 Accepted: 4613Description有N个小孩围成一圈,给他们从1开始依次编号,现指定从第W个开始报数,报到第S个时,该小孩出列,然后从下一个小孩开始报数,仍是报到S个
2014-07-20 19:49:03 620
原创 POJ 3080 Blue Jeans
表示今天下午ac了一道放置几天的问题,开心=。=Blue JeansTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11795 Accepted: 5099DescriptionThe Genographic Project is a re
2014-07-20 14:29:45 979
原创 strstr函数
strstr() 函数搜索一个字符串在另一个字符串中的第一次出现。找到所搜索的字符串,则该函数返回字符串的地址;如果未找到所搜索的字符串,则返回NULL。外文名strstr类 型PHP、C语言中的库函数目录1PHP语言中strstr函数▪ 语法▪ 提示▪ 实例
2014-07-20 11:42:18 2693
原创 Modular multiplication of polynomials
#include #includeusing namespace std;int pd(int sum[],int ls,int h[],int lh)//判断sum是否大于h{ if(ls>lh) return 1; if(ls<lh) return -1; if(ls==lh) { int i; for(i=ls-1;i>=0;i--) { if(su
2014-07-18 11:03:10 921
转载 memset函数
memset函数的用法#include void* memset(void* s, int c, size_t n){ unsignedchar* p = (unsigned char*) s; while (n> 0) { *p++ =(unsigned char) c; --n; } returns;} m
2014-07-17 16:30:53 661
转载 很特别的一个动态规划入门教程
很特别的一个动态规划入门教程今天在网上看到一个讲动态规划的文章,是以01背包为例的,这文章和书上的讲解非常不一样,令我眼前一亮,于是转载一下下~~~(说明一下,本人非常痛恨教材公式定理漫天飞,实际的讲解却讲得非常枯涩难懂,这种中国式的教育已经延绵了几千年了,现在中国的教材还是这个样子,讲清楚些明白些就那么难么?高中有个老师讲的一句话一直觉得很有道理:“教得会天才不是真本事,能把
2014-07-17 08:45:25 601
原创 Adding Reversed Numbers(关于pow函数出错)
DescriptionThe Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore the dramatic advisor of ACM has decided to transfigure
2014-07-16 15:56:32 889
原创 POJ 1019 Number Sequence
DescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...Sk. Each group Sk consists of a sequence of pos
2014-07-15 11:36:01 803
原创 POJ 1833 排列
Description题目描述:大家知道,给出正整数n,则1到n这n个数可以构成n!种排列,把这些排列按照从小到大的顺序(字典顺序)列出,如n=3时,列出1 2 3,1 3 2,2 1 3,2 3 1,3 1 2,3 2 1六个排列。任务描述:给出某个排列,求出这个排列的下k个排列,如果遇到最后一个排列,则下1排列为第1个排列,即排列1 2 3…n。比如:n = 3,k
2014-07-14 19:55:03 888
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人