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男一枚
本章將介紹Windows CE 的儲存管理。我們將本章內容分為兩大部分,前半部會依序介紹 Windows CE的檔案系統類型、 Windows CE儲存管理結構和每一個層次、以及如何自行開發檔案系統並載入之,後半部則以Ramdisk上的檔案系統為例,實際分析儲存管理相關的原始程式碼與資料型態。
上傳時間: 2015-07-01
上傳用戶:685
上下文無關文法(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
USB是PC體系中的一套全新的工業標準,它支持單個主機與多個外接設備同時進行數據交換。 首先會介紹USB的結構和特點,包括總線特徵、協議定義、傳輸方式和電源管理等等。這部分內容會使USB開發者和用戶對USB有一整體的認識。
標簽: USB
上傳時間: 2015-10-18
上傳用戶:lixinxiang
一:需求分析 1. 問題描述 魔王總是使用自己的一種非常精練而抽象的語言講話,沒人能聽懂,但他的語言是可逐步解釋成人能聽懂的語言,因為他的語言是由以下兩種形式的規則由人的語言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在這兩種形式中,從左到右均表示解釋.試寫一個魔王語言的解釋系統,把 他的話解釋成人能聽得懂的話. 2. 基本要求: 用下述兩條具體規則和上述規則形式(2)實現.設大寫字母表示魔王語言的詞匯 小寫字母表示人的語言的詞匯 希臘字母表示可以用大寫字母或小寫字母代換的變量.魔王語言可含人的詞匯. (1) B --> tAdA (2) A --> sae 3. 測試數據: B(ehnxgz)B 解釋成 tsaedsaeezegexenehetsaedsae若將小寫字母與漢字建立下表所示的對應關系,則魔王說的話是:"天上一只鵝地上一只鵝鵝追鵝趕鵝下鵝蛋鵝恨鵝天上一只鵝地上一只鵝". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鵝 | 追 | 趕 | 下 | 蛋 | 恨 |
上傳時間: 2014-12-02
上傳用戶:jkhjkh1982
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
本書分為上篇、中篇和下篇三個部分,上篇為Windows CE結構分析,中篇為Windows CE情景分析,下篇為實驗手冊。每一篇又劃分為若 干章。上篇包含有引言,Windows CE體系結構,處理 器排程,儲存管理 ,檔案系統和設備管理 等六 章。中篇包含有系統初始化,處理 器排程過程,分頁處理 ,檔案處理 和驅動器載入等五章。下篇包含有Windows CE應用程式開發,Windows CE系統開發,評測與總結以及實習等四章。 上篇的重點在於分析Windows CE kernel的結構以及工作原理 。這個部分是掌握Windows CE作業系統的基礎。 中篇重點在於分析Windows CE kernel的實際運行 過程。如果說 上篇是從靜態的角度 分析Windows CE kernel,那麼中篇則是試圖從動態的角度 給讀 者一個有關Windows CE kernel的描述。希望讀 者能夠通過對中篇的閱讀 理 解,在頭腦中形成有關Windows CE kernel的多方位的運作情景。 下篇著重於有關Windows CE的應用。對理 論 的掌握最終要應用到實務中。
標簽: 分
上傳時間: 2013-12-23
上傳用戶:FreeSky
JavaScript 和Java 除了在名字上有一點類似之外,JavaScript 也支援部分Java 的語法及基本的流程控制結構。不過,除此之外, 這兩者有結構性的差異。
標簽: JavaScript Java
上傳時間: 2016-05-28
上傳用戶:shanml
產生頻率選擇性衰落的雷利通道,參數由天線結構、OFDM系統的結構與功率延時結構來決定。
標簽:
上傳時間: 2014-12-20
上傳用戶:lizhizheng88