Ex4-22 單射函數(shù)問(wèn)題 « 問(wèn)題描述: 設(shè)函數(shù)f將點(diǎn)集S = {0,1, , n -1}映射為f (S) = { f (i) | iÎ S} Í S 。單射函數(shù)問(wèn)題要 從S中選取最大子集X Í S 使f (X )是單射函數(shù)。 例如,當(dāng)n=7, f (S) = {1,0,0,2,2,3,6} Í S 時(shí), X = {0,1,6} Í S 是所求的最大子集。 « 編程任務(wù): 對(duì)于給定的點(diǎn)集S = {0,1, , n -1}上函數(shù)f,試用抽象數(shù)據(jù)類型隊(duì)列,設(shè)計(jì)一個(gè)O(n)時(shí) 間算法,計(jì)算f的最大單射子集。 « 數(shù)據(jù)輸入: 由文件input.txt 提供輸入數(shù)據(jù)。文件的第1 行有1 個(gè)正整數(shù)n,表示給定的點(diǎn)集 S = {0,1, , n -1}。第2 行是f (i)的值,0 £ i < n。 « 結(jié)果輸出: 程序運(yùn)行結(jié)束時(shí),將計(jì)算出的f的最大單射子集的大小輸出到output.txt中。 輸入文件示例 輸出文件示例 input.txt 7 1 0 0 2 2 3 6 output.txt 3
標(biāo)簽: Iacute 61516 laquo Icirc
上傳時(shí)間: 2016-05-28
上傳用戶:tyler
% EM algorithm for k multidimensional Gaussian mixture estimation % % Inputs: % X(n,d) - input data, n=number of observations, d=dimension of variable % k - maximum number of Gaussian components allowed % ltol - percentage of the log likelihood difference between 2 iterations ([] for none) % maxiter - maximum number of iteration allowed ([] for none) % pflag - 1 for plotting GM for 1D or 2D cases only, 0 otherwise ([] for none) % Init - structure of initial W, M, V: Init.W, Init.M, Init.V ([] for none) % % Ouputs: % W(1,k) - estimated weights of GM % M(d,k) - estimated mean vectors of GM % V(d,d,k) - estimated covariance matrices of GM % L - log likelihood of estimates %
標(biāo)簽: multidimensional estimation algorithm Gaussian
上傳時(shí)間: 2013-12-03
上傳用戶:我們的船長(zhǎng)
Tasks Read the textbook about the details of Vigenére Cipher. Implement the algorithm by C or C++. Requirements You do this lab in a group of two students. Your program should have input and output as follows: csci>a.out --> Please input the key: receptive --> Please input the plain text: wearediscoveredsaveyourself --> The cipher text is : nicvtwqngfzgvtwavzvcqyglmgj -->The original message is: wearediscoveredsaveyourself • You should test your program with several runs.
標(biāo)簽: the Implement algorithm textbook
上傳時(shí)間: 2013-12-21
上傳用戶:bruce5996
% decode with soft-input viterbi algorithm 硬判決 % //k=4,r=1/2 %輸入數(shù)據(jù)為軟信息,并且數(shù)據(jù)為均值為1的BPSK調(diào)制,如果均值為MEAN,那么62,63,103,104行應(yīng)做相應(yīng)修改
標(biāo)簽: soft-input algorithm viterbi decode
上傳時(shí)間: 2014-10-28
上傳用戶:aig85
This example code takes and averages 2048 analog measurements from input P1.4 using ADC0, then prints the results to a terminal window via the UART.
標(biāo)簽: measurements averages example analog
上傳時(shí)間: 2016-06-13
上傳用戶:xuan‘nian
sorting input lines developed by C++ in linux environment
標(biāo)簽: environment developed sorting input
上傳時(shí)間: 2013-11-28
上傳用戶:lgnf
Description 為了宣傳本次“網(wǎng)宿科技杯”廈門大學(xué)第五屆程序設(shè)計(jì)競(jìng)賽,系里面做了兩張精美的海報(bào)。經(jīng)過(guò)了精確的計(jì)算,為了達(dá)到最佳美觀效果,每張海報(bào)都有自己最佳的粘貼位置。但是現(xiàn)在問(wèn)題是,如果兩張海報(bào)都要求貼在最佳位置時(shí),很有可能有部分地方會(huì)重疊在一起。現(xiàn)在您來(lái)判斷一下這兩張海報(bào)是否重疊。 Input 輸入包含兩行,每一行有四個(gè)整數(shù)來(lái)描述這個(gè)海報(bào)的最佳粘貼位置,X,Y,W,H(-10000<= X,Y <= 10000)(0 < W, H <= 10000),X,Y表示海報(bào)左下角的坐標(biāo),W,H分別表示寬度和高度。 Output 輸出"Yes"表示兩張海報(bào)互相重疊(表示存在一個(gè)面積大于0的公共區(qū)域),否則輸出"No"。(不包含引號(hào),注意大小寫(xiě)) Sample Input -10 -10 20 30 0 0 30 20 Sample Output Yes
標(biāo)簽: Description 大學(xué) 程序設(shè)計(jì) 競(jìng)賽
上傳時(shí)間: 2016-06-26
上傳用戶:gxf2016
The goal of our final project was to design an efficient elevator simulator that can accept input from a user and mechanically operate (on a small scale) a system of 4 floors and 3 elevators using pulleys and stepper motors. Users enter input using physical pushbuttons or the computer. This input is then processed by the MCU and orders are given to the elevators. We attempted to devise an algorithm that can optimally handle any number of floors. This project seemed like a fun challenge and something that had practical applications. Both of us have been frustrated at times by the inefficiency of some of the elevators here at Cornell, and we wanted to see if we could do a better job.
標(biāo)簽: efficient simulator elevator project
上傳時(shí)間: 2013-11-25
上傳用戶:cjf0304
huffman decode all you need is input a data so that it will decode
標(biāo)簽: decode huffman input data
上傳時(shí)間: 2016-07-05
上傳用戶:AbuGe
包含拼音和筆畫(huà)輸入的中文輸入法,使用VC.NET2003開(kāi)發(fā).portable Chinese input method includes phonetic input and stroke, the use of VC.NET2003 development, WINCE.NET also can be used to understand the system and the family system!
標(biāo)簽: input portable includes phonetic
上傳時(shí)間: 2013-12-30
上傳用戶:15071087253
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1