729 - The Hamming Distance Problem
摘要:// 题意: // 输入两个整数N, H,按照字典序输出所有长度为N,恰好包含H个1的01串 // 规模:1#include const int maxn = 20;int N, H, bits[maxn];// 从bits[d]开始确定,已经用了c0个0和c1个1void gen(int d, int c0, int c1) { if(d == N) { if(c1 ...
阅读全文
posted @ 2014-04-28 17:07