原创 strassen矩陣乘法,分治實現
#include <cstdio> #include<cstdlib> int judge(int n) { if(n==1) return 0; while(n!=1&&n%2==0) n/=2; if(n==1) r
原创 1201:Fibonacci Again
Problem Description There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).
原创 1003:max sum
Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence.
原创 1019:Least Common Multiple
Problem Description The least common multiple (LCM) of a set of positive integers is the smallest positive integer whic
原创 1022:Train Problem I
Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to g
原创 1016:Prime Ring Problem
Problem Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circl
原创 回溯法求解八數碼問題
code: #include<cstdio> int path[4]; int backtrack(int n) { if(n==4) { for(int i=0;i<4;i++) printf("%d%d ",i
原创 算法練習導引
準備簡歷(別寫精通,問到時要能談,一定不要有假,突出重點)有時間看《算法導論》、《編程珠璣》、《編程之美》等準備經典算法,比如快排、堆排等,一定要很熟的coding面試突擊,搞定何海濤博客49題,熟練coding之(http://zhed
原创 1009:FatMouse' Trade
Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse contain
原创 1013:Digital Roots
Problem Description The digital root of a positive integer is found by summing the digits of the integer. If the result
原创 學習linux/unix編程方法的建議
學習路徑: 首先先學學編輯器,vim, emacs什麼的都行。然後學make file文件,只要知道一點就行,這樣就可以準備編程序了。 然後看看《C程序設計語言》K&R,這樣呢,基本上就可以進行一般的編程了,順便找本數據結構的書來看
原创 1007:Quoit Design
Problem Description Have you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some
原创 網絡編程
經過多年的網絡編程實踐之後,個人覺得初學網絡編程者可以從以下幾個步驟開展: 1)下載一個可以互動的學習工具,通過這個與這個工具互動,我們可以及時的學到每個api的結果如果。我個人強烈推薦一個互動好工具,即python,下載地
原创 1005:Number Sequence
Problem Description A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mo
原创 1023:Train Problem II
Problem Description As we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the