多维多选择背包问题(MMKP)是0-1背包问题的延伸,背包核已经被用来设计解决背包问题的高效算法。目的是研究如何获得一种背包核,并以此高效处理多维多选择背包问题。首先给出了一种方法确定MMKP的核,然后阐述了利用核精确解决MMKP问题的B&B算法,列出了具体的算法步骤。在分析了算法的存储复杂度后,将算法在各种实例上的运行效果与目前解决MMKP问题的常用算法的运行效果进行了比较,发现本文的算法性能优于以往任何算法。
上传时间: 2013-11-20
上传用户:wangw7689
题目:利用条件运算符的嵌套来完成此题:学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示。 1.程序分析:(a>b)?a:b这是条件运算符的基本例子。
上传时间: 2015-01-08
上传用户:lifangyuan12
RSA算法 :首先, 找出三个数, p, q, r, 其中 p, q 是两个相异的质数, r 是与 (p-1)(q-1) 互质的数...... p, q, r 这三个数便是 person_key,接著, 找出 m, 使得 r^m == 1 mod (p-1)(q-1)..... 这个 m 一定存在, 因为 r 与 (p-1)(q-1) 互质, 用辗转相除法就可以得到了..... 再来, 计算 n = pq....... m, n 这两个数便是 public_key ,编码过程是, 若资料为 a, 将其看成是一个大整数, 假设 a < n.... 如果 a >= n 的话, 就将 a 表成 s 进位 (s
标签: person_key RSA 算法
上传时间: 2013-12-14
上传用户:zhuyibin
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
基于MCS-51单片机的数字钟设计 [摘要] III [ABSTRACT] IV 引言 1 1绪论 2 1.1 集成电路 2 1.2 主要技术的背景 2 1.2.1 发展历史 2 1.2.2 现状 3 1.2.3 发展趋势 3 2器件简介 4 2.1 LED显示器 4 2.1.1 LED显示器的结构 4 2.1.2 LED的接线形式 5 2.2 AT89C52简介 5 2.2.1 AT89C52主要性能参数: 5 2.2.2 AT89C52单片机的功能特性概述: 6 2.3 DS1302芯片 9 2.3.1 DS1302的性能特性: 9 2.3.2 DS1302数据操作原理 10 2.4 74LS164-八位移位寄存器 14 2.4.1 74LS64简介 14 2.4.2 74LS164逻辑介绍: 15 3硬件电路 17 3.1 线路的设计 17 3.1.1 电源转换模块 18 3.1.2 主控制模块 18 3.1.3 显示模块 19 3.1.4 键盘接口设计 20 3.2 电路图的绘制 20 3.3 电路板的焊接 20 3.4 打开电源前应注意的问题 20 4软件设计部分 21 4.1 阳历程序的设计 21 4.2 时间调整程序设计 21 4.3 阴历程序设计 23 5调试 28 6小结 29 7致谢 30 8参考文献 31 9附录 32
上传时间: 2015-10-17
上传用户:xuan‘nian
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
S60-programming-a-tutorial-guide-symbian. 1 Introduction to Mobile-Phone Systems 1 1.1 Wireless Technologies 1 1.2 Cellular Systems 2 1.3 Elements of a Mobile-Phone System 4 1.4 Keeping Users’ Calls Separate 5 1.5 Multipath Propagation 7 1.6 2G Mobile-Phone Systems 9 1.7 GPRS Systems 10 1.8 3G Mobile-Phone Systems 13 1.9 IP Multimedia Subsystem 16 1.10 Mobile-Phone Hardware 17 2 Introduction to Symbian OS 19 Introduction 19 2.1 The Development of Symbian OS 20 2.2 Symbian OS User Interfaces 21 2.3 Coding Idioms 23 2.4 Tool Chains 28 3 The Console Application 33 Introduction 33 3.1 Creating a Console Application 33 3.2 CBase Classes 38 3.3 Protecting Memory 38 3.4 Putting It Into Practice: An Engine for a Simple Card Game 46 Summary 56
标签: programming-a-tutorial-guide-symb Introduction Mobile-Phone Wireless
上传时间: 2016-05-14
上传用户:dianxin61
1. 热带有几个季节? 2个 2. 亚洲耕地面积最大的国家是:印度 3. “海的女儿”是哪个城市的城徽?哥本哈根 4. 被称为“老人国”的星系是哪一星系?椭圆星系 5. 妙应寺白塔始建于元朝至元八年(公元1271年),由当时哪国的工艺家阿尼哥奉敕主持修建? 尼伯尔 6. 妙应寺白塔的刹座呈须弥座式,座上竖立着下大上小十三重相轮,即所谓的: “十三天” 7. 以下哪座塔是元大都保留至今的重要标志,也是我国现存最早最大的一座藏式佛塔。妙应寺白塔 8. 称为“数学之神”的科学家是: 阿基米德 9. “薛涛笺”产生于哪个朝代?唐 10. 产生海水潮汐的主要原因是:月球引力 11. 天文学是研究什么的科学? 天体 12. 以下哪项不是天文学主要研究对象? 气象 13. 天文学家把全天空的星星按区域划分成多少个星座? 88个 14. 领土面积居世界前四位的国家是:俄罗斯、中国、加拿大、美国 15. 加拿大的领土面积在世界上排第几?第2
标签: 公务员常识_(绝对全)
上传时间: 2015-04-04
上传用户:fly心与心
获取计算机IP地址等网络参数 UDP聊天程序 TCP聊天程序 浏览器的实现
标签: 获取计算机的名称和IP地址 基本C/S模式的通信实验
上传时间: 2015-04-12
上传用户:scnbyh