源代码\用动态规划算法计算序列关系个数 用关系"<"和"="将3个数a,b,c依次序排列时,有13种不同的序列关系: a=b=c,a=b<c,a<b=v,a<b<c,a<c<b a=c<b,b<a=c,b<a<c,b<c<a,b=c<a c<a=b,c<a<b,c<b<a 若要将n个数依序列,设计一个动态规划算法,计算出有多少种不同的序列关系, 要求算法只占用O(n),只耗时O(n*n).
上传时间: 2013-12-26
上传用户:siguazgb
The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d . Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet. Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1. Definition
标签: government streamline important alphabet
上传时间: 2015-06-09
上传用户:weixiao99
上下文无关文法(Context-Free Grammar, CFG)是一个4元组G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一组有限的产生式规则集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素称为非终结符,T的元素称为终结符,S是一个特殊的非终结符,称为文法开始符。 设G=(V, T, S, P)是一个CFG,则G产生的语言是所有可由G产生的字符串组成的集合,即L(G)={x∈T* | Sx}。一个语言L是上下文无关语言(Context-Free Language, CFL),当且仅当存在一个CFG G,使得L=L(G)。 *⇒ 例如,设文法G:S→AB A→aA|a B→bB|b 则L(G)={a^nb^m | n,m>=1} 其中非终结符都是大写字母,开始符都是S,终结符都是小写字母。
标签: Context-Free Grammar CFG
上传时间: 2013-12-10
上传用户:gaojiao1999
全球迅猛发展的 Internet 网络给世界经济带来了新的商机,数字技术提供了与原作品同样精美的复制品, 但同时使得数字媒体的版权保护问题日益突出。 本文介绍了最新的多媒体版权保护技术-数字水印的概念,在阐述数字水印的分类和特性的基础上,提出了以数字水印为基础的数字作品版权保护系统,并研究了数字水印系统的处理框架和数字水印算法。最后对数字水印技术进行了展望。
上传时间: 2013-12-02
上传用户:ouyangtongze
这是我做的毕业设计,是基于DSP的数字图象压缩系统的实现。本系统能很好的压缩图象,系统运行时间快,压缩比也比较高。其中采用JPEG标准对图象进行压缩,使用了Huffman算法。
标签: 毕业设计
上传时间: 2015-11-05
上传用户:a3318966
本人平时收集的惯性导航算法的论文,对搞导航算法的人很有帮助。 1.易于实现的捷联式惯性导航系统仿真.pdf 2.测量运动物体姿态的三自由度定位算法的研究.pdf 3.基于MEMS 技术的微型惯性测量组合.pdf 4.基于四元数的空间全方位算法研究.pdf 5.捷联惯导积分算法设计(连载二)下篇:速度和位置算.pdf 6.数字磁罗经系统的设计.pdf 7.四阶龙格—库塔法在捷联惯导系统姿态解算中的应用.pdf
上传时间: 2014-12-07
上传用户:ayfeixiao
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
标签: represented integers group items
上传时间: 2016-01-17
上传用户:jeffery
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa. For example, >> project.name = MyProject >> project.id = 1234 >> project.param.a = 3.1415 >> project.param.b = 42 becomes with str=xml_format(project, off ) "<project> <name>MyProject</name> <id>1234</id> <param> <a>3.1415</a> <b>42</b> </param> </project>" On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
标签: converts Toolbox complex logical
上传时间: 2016-02-12
上传用户:a673761058
Lensphoto的加密狗,数字近景摄影测量系统的软件加密狗驱动。
上传时间: 2016-03-27
上传用户:lvzhr
matlab实现的多个基础程序和报告并有流程图(1) 绘出正弦信号波形及频谱。 (2) 单极性归零(RZ)波形及其功率谱,占空比为50%。 (3) 升余弦滚降波形的眼图及其功率谱。滚降系数为0.5。发送码元取值为0、2。 (4) 最佳基带系统的Pe~Eb\No曲线,升余弦滚降系数a=0.5,取样值的偏差是Ts/4。 (5) Pe~Eb\No,升余弦滚降系数a=0.5,取样时间无偏差,但信道是多径信道,C(f)=abs(1-0.5*exp(-j*2*pi*f*dt)),dt=Ts/2。 (6) 仿真数字基带传输系统,包括输入、输出信号波形及其功率谱,眼图(升余弦滚降系数a=0.5),Pe~Eb\No曲线,取样时间无偏差。
上传时间: 2014-01-22
上传用户:aix008