數(shù)字運算,判斷一個數(shù)是否接近素數(shù) A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no
上傳時間: 2015-05-21
上傳用戶:daguda
源代碼\用動態(tài)規(guī)劃算法計算序列關系個數(shù) 用關系"<"和"="將3個數(shù)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個數(shù)依序列,設計一個動態(tài)規(guī)劃算法,計算出有多少種不同的序列關系, 要求算法只占用O(n),只耗時O(n*n).
標簽: lt 源代碼 動態(tài)規(guī)劃 序列
上傳時間: 2013-12-26
上傳用戶:siguazgb
自適應算術編碼 C語言This package was adapted from the program in "Arithmetic Coding for Data Compression", by Ian H. Witten
標簽: Compression Arithmetic package adapted
上傳時間: 2013-12-06
上傳用戶:ryb
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
JaNet: Java Neural Network Toolkit resume: A well documented toolkit for designing and training, and a java library for inclusion in third party programs. description: jaNet package is a java neural network toolkit, which you can use to design, test, train and optimize an ideal Neural Network for your private application. You can then include your saved network in your program using the jaNet.backprop package. The consequent documentation is only in french for the moment, but an english translation is planned. The java source code is released under GPL, and can be compiled with JDK, Symantec Cafe or MS Visual J
標簽: documented designing training Network
上傳時間: 2016-04-15
上傳用戶:zhanditian
Java library for encoding/decoding MMS messages. Also provides a simlpe client for sending MMS through a WAP gateway.
上傳時間: 2014-01-02
上傳用戶:zyt
DTNSim2 is a simulator for Delay-Tolerant Networks (DTNs) written in Java. It is based on Sushant Jain s DTNSim, which was used for the Routing in a delay tolerant network paper. It has been exensively modified.
標簽: Delay-Tolerant simulator Networks DTNSim2
上傳時間: 2016-11-06
上傳用戶:tianyi223
We propose a technique that allows a person to design a new photograph with substantially less effort. This paper presents a method that generates a composite image when a user types in nouns, such as “boat” and “sand.” The artist can optionally design an intended image by specifying other constraints. Our algorithm formulates the constraints as queries to search an automatically annotated image database. The desired photograph, not a collage, is then synthesized using graph-cut optimization, optionally allowing for further user interaction to edit or choose among alternative generated photos. An implementation of our approach, shown in the associated video, demonstrates our contributions of (1) a method for creating specific images with minimal human effort, and (2) a combined algorithm for automatically building an image library with semantic annotations from any photo collection.
標簽: substantially photograph technique propose
上傳時間: 2016-11-24
上傳用戶:三人用菜
The Bit Array structure provides a compacted arrays of Booleans, with one bit for each Boolean value. A 0 [1] bit corresponds to the Boolean value false [true], respectively. We can look at a stream of bytes as a stream of bits each byte contains 8 bits, so any n bytes hold n*8 bits. And the operation to manipulate this stream or bits array is so easy, jut read or change the bits state or make any Boolean operation on the whole bits array, like 鈥楢ND鈥? 鈥極R鈥? or 鈥榅OR鈥?
標簽: structure compacted Booleans provides
上傳時間: 2014-01-15
上傳用戶:壞天使kk
We analyze, both analytically and numerically, the effectiveness of cloaking an infinite cylinder from observations by electromagnetic waves in three dimensions. We show that, as truncated approximations of the ideal permittivity and permeability tensors tend towards the singular ideal cloaking fields, so that the anisotropy ratio tends to infinity, the D and B fields blow up near the cloaking surface. Since the metamaterials used to implement cloaking are based on effective medium theory, the resulting large variation in D and B will pose a challenge to the suitability of the field averaged characterization of " and 碌. We also consider cloaking with and without the SHS (softand- hard surface) lining, shown in [6] to be theoretically necessary for cloaking in the cylindrical geometry. We demonstrate numerically that cloaking is significantly improved by the SHS lining, with both the far field of the scattered wave significantly reduced and the blow up of D and B prevented.
標簽: effectiveness analytically numerically cloaking
上傳時間: 2017-03-30
上傳用戶:zxc23456789