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
在线教育系统绪言…………………………………………………………………………………………… 1 1.系统设计与实现…………………………………………………………………………… 1 1)目标设计……………………………………………………………………………… 1 2)设计思想……………………………………………………………………………… 2 3)系统功能分析与设计………………………………………………………………… 2 2.数据库设计与实现………………………………………………………………………… 3 1)数据库的需求分析…………………………………………………………………… 3 2)数据库的逻辑设计…………………………………………………………………… 3 3.数据库的配置……………………………………………………………………………… 4 4.前端网络页面的设计与开发……………………………………………………………… 5 1)系统公用页面…………
标签: 系统设计
上传时间: 2013-11-28
上传用户:2467478207
基于tms320vc55*系列DSP常用算法,包括: 1. Experiment 7A - Radix-2 Complex FFT in C 2. Experiment 7B - Radix-2 Complex FFT in C55x Assembly Language 3. Experiment 7C - Radix-2 Complex FFT and IFFT 4. Experiment 7C - Fast Convolution 5. matlab 源码
上传时间: 2015-06-30
上传用户:PresidentHuang
zemax源码: This DLL models a standard ZEMAX surface type, either plane, sphere, or conic The surface also demonstrates a user-defined apodization filter The filter is defined as part of the real ray trace, case 5 The filter can be used at the stop to produce x-y Gaussian apodization similar to the Gaussian pupil apodization in ZEMAX but separate in x and y. The amplitude apodization is of the form EXP[-(Gx(x/R)^2 + Gy(y/R)^2)] The transmission is of the form EXP[-2(Gx(x/R)^2 + Gy(y/R)^2)] where x^2 + y^2 = r^2 R = semi-diameter The tranmitted intensity is maximum in the center. T is set to 0 if semi-diameter < 1e-10 to avoid division by zero.
标签: standard surface models either
上传时间: 2013-12-05
上传用户:003030
上下文无关文法(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
产生一个正交相位调制信号(QPSK),该信号可供复数解析,调制相位为(0,pi/2,pi,3*pi/2)
上传时间: 2015-09-18
上传用户:rocketrevenge
用PHP编写的表达式计算器,是用的编译的知识实现的,并非使用eval()函数实现。 功能强大,可以做所有的数值计算,代数计算还不能实现。 1。可以计算形如“-3*sin(2^0.5/2+3.1415)-pi()^2”的式子。 2。能识别数字(包括小数、正负数)、数学函数。 3。可以做加、减、乘、除、指数、取模 计算(其中加、减包括一元和二元两种操作)。 压缩包里的“math.php”是演示文件
上传时间: 2013-12-11
上传用户:comua
在sco unix 下显示前n天或后n天日期的处理程序。 printf("功能: 时间戳与时间格式字符串的转换程序\n") printf(" -i 输入的参数为时间戳\n") printf(" -s 输入的参数为格式化时间\n") printf(" -t 输入的时间取当前系统时间\n") printf(" -x 输入的时间增加或减少的天数\n") printf(" -o 输出的时间为时间戳格式\n") printf(" -O 输出的时间为格式化时间\n") printf(" -h 帮助文件-查看[format]如何定义,例 %s -h\n",procname) printf("范例:1 取当前日期的前2天的时间显示 %s -t -x -2\n",procname) printf(" 2 取20030101的前5天的时间显示 %s -s 20030101000000 -x -5\n",procname) printf(" 3 取20031231的后5天的时间显示 %s -s 20031231000000 -x 5 -O \"%%D %%T\"\n",procname) printf(" 4 取时间戳为1089619417的时间显示 %s -i 1089619417 \n",procname) printf(" 5 取时间戳为1089619417的后4天的时间显示 %s -i 1089619417 -x 4 \n",procname)
上传时间: 2015-10-17
上传用户:TRIFCT
银行代收电话费管理系统1.0功能叙述 使用文件管理整个收费信息,内容有:客户姓名C16,电话号码N11,市话费F7.2,长途费F7.2,信息费F7.2,ADSL费F7.2,费用合计F8.2,对应年月N6,收费状态C(0――未收,1――已收),收费日期D,银行帐号N20,收费人编姓名.
上传时间: 2015-11-11
上传用户:wsf950131
本文主要讲了C语言编写魔王语言解释系统,把魔王抽象的语言通过进队出队按照规则α 转换为 β1β2…βm 和θδ1δ2…δn 转换为 θδnθδn-1… θδ1θ 进行解释,最后解释译成我们能够看懂得语言。同时也讲述了在编写调试程序中一些需注意的问题,如调试程序的步骤。通过队的应用(出队入队)以及其他相关知识完成了这次课程设计。
上传时间: 2015-11-26
上传用户:weiwolkt