随笔分类 -  入门经典(白书)

lrj的书,这个寒假就练这本了~~
摘要:#include <iostream>#include <cstring>using namespace std;const int MAXD = 20; int s[1<<MAXD];//左位移,表示2的MAXD次方int main(){ int D,I; while(cin >> D >> I) { memset(s,0,sizeof(s)); int k,n = (1<<D)-1; //n是最大节点编号 for(int i = 0; i < I; ++i) { k = 1; ... 阅读全文
posted @ 2013-01-21 21:13 see_why 阅读(249) 评论(0) 推荐(0)
摘要:#include <iostream>using namespace std;void print_permutation(int n,int * A,int cur){ int i,j; if(cur == n) //递归边界 { for(i = 0; i < n; ++i) cout << A[i] << ' '; cout << endl; } else for(int i = 1; i <= n; ++i) //尝试在A[cur]中填各种整数i { int ok = 1; for... 阅读全文
posted @ 2013-01-21 20:33 see_why 阅读(174) 评论(0) 推荐(0)