随笔分类 - Algorithm
algorithms
摘要:在线性时间里求素数表 C++ include include const int maxn = 1000000; bool isPrime[maxn]; int table[maxn]; int cnt; void getPrime() { memset(isPrime,1,sizeof(isPri
阅读全文
摘要:排序的同时求逆序数 C++ include include include using namespace std; const int maxn = 1e6 +5; int arr[maxn]; int cnt = 0; void merge_sort(int b, int e) { if(b =
阅读全文
摘要:KMP C++ include include void get_next(char p,int next){ int pLen = strlen(p); next[0] = 1; int k = 1,j = 0; while(j
阅读全文
浙公网安备 33010602011771号