源代碼\用動態規劃算法計算序列關系個數 用關系"<"和"="將3個數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個數依序列,設計一個動態規劃算法,計算出有多少種不同的序列關系, 要求算法只占用O(n),只耗時O(n*n).
上傳時間: 2013-12-26
上傳用戶:siguazgb
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男一枚
一款文件上傳程序,注冊使用多用戶,可以分配用戶的空間默認容量,也可單獨配置某個用戶享有的容量,可自定義上傳類型,可以自動生成論壇貼圖代碼.
上傳時間: 2015-06-20
上傳用戶:xsnjzljj
網絡代理程序,實現基本的代理轉發功能。可自由配置代理服務器IP/端口以及目標主機的IP/端口。此程序示范了代理的工作機理和一些網絡編程技巧,具有參考和引用價值。
上傳時間: 2015-12-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
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
對讀入一個字節(不帶回車)讀入一個字符串帶回車,發送字符串函數測試成功 由于不清楚keil自帶的STDIO.H函數是否是堵塞發送接受,所以本程序使用非堵塞方式發送接受,缺點是占 用一些內存,緩沖區大小可自由配置。
上傳時間: 2016-06-27
上傳用戶:thesk123
用來為垂直搜索引擎抓取數據的采集系統,采用多線程。智能界面化控制,想抓取的戰點或內容簡單配置一下即可以運行,采集來的數據自動保存到數據庫。數據庫可自行配置。
上傳時間: 2013-12-18
上傳用戶:a673761058
本程序實現通過BDM方式訪問MOTOROLA 9S12單片機EEPROM,可自動配置波特率,包含讀、寫、擦除三種功能。
上傳時間: 2016-10-17
上傳用戶:風之驕子