随笔分类 - 统计颜色
摘要:"HDU 6070 Partition" Problem : 给一段长度为n的序列,要求找出一段区间,使得这段区间的数字种类除以区间长度最小。输出最后的答案即可。(n include include include include include include include include in
阅读全文
摘要:" HDU 6035 Colorful Tree" Problem : 给一棵树,每个结点有一种颜色,定义每条路径的权值为这条路径上颜色的种数,询问所有路径(C(n,2)条)的权值之和。 Solution : 分开考虑每种颜色对答案的贡献。对于一种颜色,一共有C(n,2)条路径,再考虑问题的反面。不
阅读全文

浙公网安备 33010602011771号