虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

N.<b>I.</b>S.T.

  • 算法的许多例子都是最优化问题( optimization problem)

    算法的许多例子都是最优化问题( optimization problem),每个最优化问题都包含一组限制条件( c o n s t r a i n t)和一个优化函数( optimization function),符合限制条件的问题求解方案称为可行解( feasible solution),使优化函数取得最佳值的可行解称为最优解(optimal solution)。

    标签: optimization problem 算法

    上传时间: 2014-08-25

    上传用户:123456wh

  • We have a group of N items (represented by integers from 1 to N), and we know that there is some tot

    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

  • (1) 、用下述两条具体规则和规则形式实现.设大写字母表示魔王语言的词汇 小写字母表示人的语言词汇 希腊字母表示可以用大写字母或小写字母代换的变量.魔王语言可含人的词汇. (2) 、B→tAdA A

    (1) 、用下述两条具体规则和规则形式实现.设大写字母表示魔王语言的词汇 小写字母表示人的语言词汇 希腊字母表示可以用大写字母或小写字母代换的变量.魔王语言可含人的词汇. (2) 、B→tAdA A→sae (3) 、将魔王语言B(ehnxgz)B解释成人的语言.每个字母对应下列的语言.

    标签: 字母 tAdA 语言 词汇

    上传时间: 2013-12-30

    上传用户:ayfeixiao

  • 对PL0原编译器进行了以下的扩充:1.增加以下保留字else(elsesym), for(forsym),to(tosym),downto(downtosym),return(returnsym),[

    对PL0原编译器进行了以下的扩充:1.增加以下保留字else(elsesym), for(forsym),to(tosym),downto(downtosym),return(returnsym),[(lmparen),](rmparen) 2.增加了以下的运算符:+=(eplus),-=(eminus),++(dplus),--(dminus) 取址运算符&(radsym),指向运算符@(padsym) 3.修改单词:修改不等号#为<> 4.扩充语句:(1)增加了else子句 (2)增加了for语句 5.增加运算:(1).++运算 (2).--运算;(3).+=运算 (4).-=运算;(5).&取址运算; (6).@指向运算; 6.增加类型:(1).增加多维数组a[i1][i2][i3]……[i(n-1)][i(n-2)][in] (2).增加指针类型(任何变量都能存放指针,但不支持指针的指针,如b:=@@a应该改写为c:=@a,b:=@c) 7.将过程procedure扩展为函数:(1).允许定义过程时在其后加参数(var a, var b,……..,var n) (2)允许通过指针向函数形式参数传地址;(3)允许返回值;可以用 a:=p(a,b,c….,n) 返回

    标签: downtosym returnsym elsesym downto

    上传时间: 2016-07-02

    上传用户:saharawalker

  • 1.有三根杆子A,B,C。A杆上有若干碟子 2.每次移动一块碟子,小的只能叠在大的上面 3.把所有碟子从A杆全部移到C杆上 经过研究发现

    1.有三根杆子A,B,C。A杆上有若干碟子 2.每次移动一块碟子,小的只能叠在大的上面 3.把所有碟子从A杆全部移到C杆上 经过研究发现,汉诺塔的破解很简单,就是按照移动规则向一个方向移动金片: 如3阶汉诺塔的移动:A→C,A→B,C→B,A→C,B→A,B→C,A→C 此外,汉诺塔问题也是程序设计中的经典递归问题

    标签: 移动 发现

    上传时间: 2016-07-25

    上传用户:gxrui1991

  • I often need a simple function generator. Just to generate a certain frequency. After all the years

    I often need a simple function generator. Just to generate a certain frequency. After all the years I ve worked with electronics, I still haven t got me one. Even though I need it now and then, I just couldn t seem to justify the cost of one. So, standard solution - build one yourself. I designed a simple sinewave generator based on a Analog Devices AD9832 chip. It will generate a sinewave from 0.005 to 12 MHz in 0.005 Hz steps. That s pretty good, and definitely good enough for me ! But while waiting for the AD9832 chip to arrive, I came up with a very simple version of the DDS synth, using just the 2313 and a resistor network.

    标签: frequency generator function generate

    上传时间: 2013-12-17

    上传用户:thesk123

  • Euler函数: m = p1^r1 * p2^r2 * …… * pn^rn ai >= 1 , 1 <= i <= n Euler函数: 定义:phi(m) 表示小于等

    Euler函数: m = p1^r1 * p2^r2 * …… * pn^rn ai >= 1 , 1 <= i <= n Euler函数: 定义:phi(m) 表示小于等于m并且与m互质的正整数的个数。 phi(m) = p1^(r1-1)*(p1-1) * p2^(r2-1)*(p2-1) * …… * pn^(rn-1)*(pn-1) = m*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pn) = p1^(r1-1)*p2^(r2-1)* …… * pn^(rn-1)*phi(p1*p2*……*pn) 定理:若(a , m) = 1 则有 a^phi(m) = 1 (mod m) 即a^phi(m) - 1 整出m 在实际代码中可以用类似素数筛法求出 for (i = 1 i < MAXN i++) phi[i] = i for (i = 2 i < MAXN i++) if (phi[i] == i) { for (j = i j < MAXN j += i) { phi[j] /= i phi[j] *= i - 1 } } 容斥原理:定义phi(p) 为比p小的与p互素的数的个数 设n的素因子有p1, p2, p3, … pk 包含p1, p2…的个数为n/p1, n/p2… 包含p1*p2, p2*p3…的个数为n/(p1*p2)… phi(n) = n - sigm_[i = 1](n/pi) + sigm_[i!=j](n/(pi*pj)) - …… +- n/(p1*p2……pk) = n*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pk)

    标签: Euler lt phi 函数

    上传时间: 2014-01-10

    上传用户:wkchong

  • 1. 下列说法正确的是 ( ) A. Java语言不区分大小写 B. Java程序以类为基本单位 C. JVM为Java虚拟机JVM的英文缩写 D. 运行Java程序需要先安装JDK

    1. 下列说法正确的是 ( ) A. Java语言不区分大小写 B. Java程序以类为基本单位 C. JVM为Java虚拟机JVM的英文缩写 D. 运行Java程序需要先安装JDK 2. 下列说法中错误的是 ( ) A. Java语言是编译执行的 B. Java中使用了多进程技术 C. Java的单行注视以//开头 D. Java语言具有很高的安全性 3. 下面不属于Java语言特点的一项是( ) A. 安全性 B. 分布式 C. 移植性 D. 编译执行 4. 下列语句中,正确的项是 ( ) A . int $e,a,b=10 B. char c,d=’a’ C. float e=0.0d D. double c=0.0f

    标签: Java A. B. C.

    上传时间: 2017-01-04

    上传用户:netwolf

  • Instead of finding the longest common subsequence, let us try to determine the length of the LCS.

    Instead of finding the longest common subsequence, let us try to determine the length of the LCS. 􀂄 Then tracking back to find the LCS. 􀂄 Consider a1a2…am and b1b2…bn. 􀂄 Case 1: am=bn. The LCS must contain am, we have to find the LCS of a1a2…am-1 and b1b2…bn-1. 􀂄 Case 2: am≠bn. Wehave to find the LCS of a1a2…am-1 and b1b2…bn, and a1a2…am and b b b b1b2…bn-1 Let A = a1 a2 … am and B = b1 b2 … bn 􀂄 Let Li j denote the length of the longest i,g g common subsequence of a1 a2 … ai and b1 b2 … bj. 􀂄 Li,j = Li-1,j-1 + 1 if ai=bj max{ L L } a≠b i-1,j, i,j-1 if ai≠j L0,0 = L0,j = Li,0 = 0 for 1≤i≤m, 1≤j≤n.

    标签: the subsequence determine Instead

    上传时间: 2013-12-17

    上传用户:evil

  • 一台精密仪器的工作时间为n 个时间单位。与仪器工作时间同步进行若干仪器维修程序。一旦启动维修程序

    一台精密仪器的工作时间为n 个时间单位。与仪器工作时间同步进行若干仪器维修程序。一旦启动维修程序,仪器必须进入维修程序。如果只有一个维修程序启动,则必须进入该维修程序。如果在同一时刻有多个维修程序,可任选进入其中的一个维修程序。维修程序必须从头开始,不能从中间插入。一个维修程序从第s个时间单位开始,持续t个时间单位,则该维修程序在第s+t-1 个时间单位结束。为了提高仪器使用率,希望安排尽可能少的维修时间。对于给定的维修程序时间表,该算法计算最优时间表。

    标签: 程序 精密仪器 单位 仪器

    上传时间: 2017-03-13

    上传用户:chongcongying