還是上傳上來吧,又一中快速冪的寫法這個快速冪的寫法比較簡單,不用求digit數組#include <stdio.h>#include <string.h>#include <iostream>#include <string>using namespace std;const int MOD = 10007;int quick_pow(int n, int m){int temp = n;int ans = 1;while (m >
Fibonacci Check-upTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 900 Accepted Submission(s): 507Problem DescriptionEvery ALPC has his own alpc-number just like alpc12, alpc55, alpc62 etc.As
Another kind of FibonacciTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1175 Accepted Submission(s): 446Problem DescriptionAs we all known , the Fibonacci series : F(0) = 1, F(1) = 1, F(N) =
Saving BeansTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1666 Accepted Submission(s): 592Problem DescriptionAlthough winter is far away, squirrels have to work day and night to save beans.
字典樹,還是很好理解的,主要是每個人都想把它寫的漂亮.順手,那麼自己就得多打,多改進了,我給大家看看我的#include <stdio.h>#include <string.h>#include <iostream>#include <string>/* *字典樹---Trie */ using namespace std;const int sta = 'a';//這是規定的起始位置 const int maxn = 26;int N;int
Largest prime factorTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4916 Accepted Submission(s): 1728Problem DescriptionEverybody knows any number can be combined by the prime number.Now,