随笔分类 - 算法_随机算法
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4712题目大意:任意两个数按位异或后二进制中含1的个数被称为海明距离,给定n个数,求出任意其中两个最小的海明数,输入是16进制。Sample Input2 2 12345 54321 4 12345 6789A BCDEF 0137FSample Output67分析:用随机数来模拟,加srand()函数,放置产生伪随机数。代码有2个。代码1: 1 # include 2 # include 3 # include 4 # include 5 # include 6 # define INF 0x3
阅读全文