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运行说明: 请输入初始功率S0,形如a+bi 请输入无限大系统母线电压V0 请输入系统等值电抗矩阵B 矩阵B有以下元素组成的行矩阵 1正常运行时的系统直轴等值电抗Xd 2故障运行时的系统直轴等值电抗X d 3故障切除后的系统直轴等值电抗 请输入惯性时间常数Tj 请输入时段数N 请输入哪个时段发生故障Ni 请输入每时段间隔的时间dt
上传时间: 2015-06-13
上传用户:it男一枚
上下文无关文法(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
自定义协议,摸拟FTP文件传输,并对传输数据进行加密,保证数据传输安全,实现初步代码,基本的一些功能,未经详细测试,欢迎有兴趣的朋友来邮:streamby@163.com
标签: 自定义协议
上传时间: 2014-01-18
上传用户:66666
课程设计(电子商务系统) 对于典型的数据库管理系统,尤其是对像电子商务这样的数据流量特别大的网络管理系统,必须要满足使用方便、操作灵活等设计需求。本系统在设计时应该满足以下几个目标: 采用人机对话的操作方式,界面设计美观友好、信息查询灵活、方便、快捷、准确、数据存储安全可靠。 全面展示商城内所有商品,并可展示最新商品及特价商品。 实现网上购物。 商品销售排行,以方便顾客了解本商城内的热销商品及帮助企业领导者做出相应的决策。 查看商城内的公告信息。 对用户输入的数据,系统进行严格的数据检验,尽可能排除人为的错误。 系统最大限度地实现了易维护性和易操作性。 系统运行稳定、安全可靠。
上传时间: 2014-01-21
上传用户:集美慧
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
本程序是DES加密系统的c语言源程序,它很可能是使用最广泛的秘钥系统,特别是在保护金融数据的安全中,通常,自动取款机(Automated Teller Machine,ATM)都使用 DES。
上传时间: 2013-12-13
上传用户:cuibaigao
这次设计的是一个汽配管理系统,系统在实施后,能实现以下目标: 1、 汽车配件进销存全部采用计算机管理。 2、 操作简单易行,查询方便灵活。 3、 系统架构清晰,界面简单大方,功能较为全面,数据存储安全可靠。 4、 系统内部控制严密,可靠性强。 5、 物流和资金流一体化。 此次设计的汽配管理系统的功能设计主要
上传时间: 2016-07-02
上传用户:youlongjian0
企业营销系统:企业营销管理系统应本着经济、实用、高效的原则,为企业提供一个高效、规范、轻松的营销工作环境,满足企业不断发展的需要。企业营销管理系统主要实现以下功能: 系统采用人机对话方式,界面美观友好,信息查询灵活、方便、快捷、准确,数据存储安全可靠。 对用户输入的数据,系统进行严格的数据检验,尽可能排除人为的错误。 万能查询器实现自由设置查询。 根据业务员的销售业绩完成比率,自动计算业务员的得分情况。 根据市场跟踪数据以图表形式显示商品的市场走势。 根据本年度的销售数据对下一年度的销售情况进行预测。 与Excel实现无缝连接,可将Excel表中的数据直接导入到系统中。 不同的操作员有不同的操作权限,增强了系统的安全性。 系统最大限度地实现了易安装性、易维护性和易操作性
上传时间: 2013-11-25
上传用户:清风冷雨
本系统属于小型的餐饮管理系统,可以有效地对中小型餐厅消费进行管理,本系统应达到以下目标: 系统采用人机交互的方式,界面美观友好,信息查询灵活、方便,数据存储安全可靠。 实现对餐厅顾客开台、点菜/加菜、账目查询和结账等操作。 对用户输入的数据,进行严格的数据检验,尽可能的避免人为错误。 实现对消费账目自动结算。 实现对消费的历史记录进行查询,支持模糊查询。 系统应最大限度地实现易维护性和易操作性。
标签: 管理系统
上传时间: 2016-11-12
上传用户:lx9076