大整數乘法例子代碼 /* 遞歸邊界,如果是1位二進制數與1位二進制數相乘,則可以直接計算 */ /*累計做1位二進制乘法運算的次數*/ /* return (X*Y) */ /* 計算n的值 */ /* 把X和Y拆分開來,令X=A*2^(n/2)+B, 左移位運算,mod = 1<<(n/2) */ /* 計算XY=AC*2^n+(AD+CB)*2^(n/2)+BD */ /* 計算A*C,再向左移n位 */ /* 遞歸計算A*D */ /* 遞歸計算C*B */ /* 計算a21+a22,再向左移n/2位 */ /* 遞歸計算B*D */ /* XY=a1+a2+a3 */
上傳時間: 2015-05-19
上傳用戶:gyq
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
* 高斯列主元素消去法求解矩陣方程AX=B,其中A是N*N的矩陣,B是N*M矩陣 * 輸入: n----方陣A的行數 * a----矩陣A * m----矩陣B的列數 * b----矩陣B * 輸出: det----矩陣A的行列式值 * a----A消元后的上三角矩陣 * b----矩陣方程的解X
上傳時間: 2015-07-26
上傳用戶:xauthu
數據結構 1、算法思路: 哈夫曼樹算法:a)根據給定的n個權值{W1,W2… ,Wn }構成 n棵二叉樹的集合F={T1,T2…,T n },其中每棵二叉樹T中只有一個帶權為W i的根結點,其左右子樹均空;b)在F中選取兩棵根結點的權值最小的樹作為左右子樹構造一棵新的二叉樹,且置新的二叉樹的根結點的權值為其左、右子樹上結點的權值之和;c)F中刪除這兩棵樹,同時將新得到的二叉樹加入F中; d)重復b)和c),直到F只含一棵樹為止。
上傳時間: 2016-03-05
上傳用戶:lacsx
(1) 、用下述兩條具體規則和規則形式實現.設大寫字母表示魔王語言的詞匯 小寫字母表示人的語言詞匯 希臘字母表示可以用大寫字母或小寫字母代換的變量.魔王語言可含人的詞匯. (2) 、B→tAdA A→sae (3) 、將魔王語言B(ehnxgz)B解釋成人的語言.每個字母對應下列的語言.
上傳時間: 2013-12-30
上傳用戶:ayfeixiao
2. 進入程序后,即會顯示提示用戶是否需要創建魔王詞匯,選擇y則用戶自己創建魔王詞匯,選擇n則使用默認的魔王詞匯為:默認的魔王詞匯(只有A=sae,B=tAdA,C=sce,D=sde)之后會有相關的作者信息。下面就提示用戶輸入魔王語句,輸入完后就會輸出翻譯后的魔王語句。
標簽: 程序
上傳時間: 2016-08-17
上傳用戶:hoperingcong
利用偉福 Lab2000P單片機實驗儀上提供的顯示電路和鍵盤電路,做一個簡單的計算器。用十六進制A鍵 =‘+’、B鍵 =‘-’、C鍵 = ‘x’、D鍵 = ‘/’、E鍵 = ‘=’、F鍵 = ‘C’。
上傳時間: 2016-08-22
上傳用戶:ukuk
flash 鍵盤音效取自win2000系統ding.wav,經過CoolEdit處理成音階,在Flash中導入在相應按鈕上。 沒有難度,就是耐心一點,成績不錯哦! 對應表: 低音G-a #G-w A-s #A-e B-d 中音C-f #C-t D-g #D-y E-h F-j #F-i G-k #G-o A-l #A-p B- 高音C-1 D-2 E-3 F-4 G-5 A-6 B-7 C(high)-8 #C-c #D-v #F-b #G-n #A-m
上傳時間: 2014-02-06
上傳用戶:ljmwh2000
made by: kangkai data:2008.11.23 this one is used to test arm7 str71x. use a led to test GPIO. a---------P0.0 b---------P0.1 c---------P0.2 d---------P0.3 e---------P0.4 f---------P0.5 g---------P0.6 just run it and you will see the led to show 0-9 all the time.
上傳時間: 2016-12-16
上傳用戶:moerwang
簡單的無線遙控音樂制作 采用HC2272,HC2262接收, 對應管腳連接: 1、無線遙控部分 D0----P1^0 D1----P1^1 D2----P1^2 D3----P1^3 VT----P3^2 2、顯示部分: 74LS48驅動共陰數碼管 A-----P3^0 B-----P3^1 C-----P3^2 D-----P3^3 3、蜂鳴器(或喇叭) P3^4
上傳時間: 2014-12-01
上傳用戶:txfyddz