上一页 1 2 3 4 5 6 7 ··· 38 下一页
摘要: P4208 [JSOI2008]最小生成树计数 题目描述 现在给出了一个简单无向加权图。你不满足于求出这个图的最小生成树,而希望知道这个图中有多少个不同的最小生成树。(如果两颗最小生成树中至少有一条边不同,则这两个最小生成树就是不同的)。由于不同的最小生成树可能很多,所以你只需要输出方案数对3101 阅读全文
posted @ 2019-08-09 20:45 yccdu 阅读(228) 评论(0) 推荐(1) 编辑
摘要: CF37C Old Berland Language sol:直接暴力模拟下去,长度加了就补0,凑个数就+1,凑不好就puts(“no”) #include <bits/stdc++.h> using namespace std; typedef int ll; inline ll read() { 阅读全文
posted @ 2019-08-08 20:10 yccdu 阅读(185) 评论(2) 推荐(1) 编辑
摘要: sol:很显然就是找出所有质因数,然后分别塞进去就行了,怎么塞就是组合数。感觉就是道小学奥数题 #include <bits/stdc++.h> using namespace std; typedef int ll; inline ll read() { ll s=0; bool f=0; cha 阅读全文
posted @ 2019-08-07 21:54 yccdu 阅读(186) 评论(0) 推荐(1) 编辑
摘要: http://codeforces.com/contest/425/problem/C 题意:两数列a[],b[],进行若干轮操作,每次操作花费e, 将a的一个前缀和b的一个前缀(两前缀的最后一个数字必须相同)删除,并得到虚拟1元,最后的一次操作是将剩下的a[],b[]全部清空,花费是之前把a[], 阅读全文
posted @ 2019-08-06 22:45 yccdu 阅读(301) 评论(0) 推荐(1) 编辑
摘要: Darth Vader and Tree CodeForces - 514E When Darth Vader gets bored, he sits down on the sofa, closes his eyes and thinks of an infinite rooted tree wh 阅读全文
posted @ 2019-08-06 18:12 yccdu 阅读(256) 评论(0) 推荐(1) 编辑
摘要: Variable, or There and Back Again CodeForces - 164A Life is not easy for the perfectly common variable named Vasya. Wherever it goes, it is either ass 阅读全文
posted @ 2019-08-03 20:40 yccdu 阅读(194) 评论(0) 推荐(1) 编辑
摘要: CF626F Group Projects 有n个学生,每个学生有一个能力值ai。现在要把这些学生分成一些(任意数量的)组,每一组的“不和谐度”是该组能力值最大的学生与能力值最小的学生的能力值的差。求所有不和谐度之和不超过k的分组方案总数。 输入输出样例 输入 #1复制 3 2 2 4 5 输出 # 阅读全文
posted @ 2019-07-31 22:33 yccdu 阅读(287) 评论(0) 推荐(0) 编辑
摘要: On Changing Tree CodeForces - 396C You are given a rooted tree consisting of n vertices numbered from 1 to n. The root of the tree is a vertex number  阅读全文
posted @ 2019-07-30 21:02 yccdu 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Correcting Mistakes CodeForces - 533E Analyzing the mistakes people make while typing search queries is a complex and an interesting work. As there is 阅读全文
posted @ 2019-07-30 20:53 yccdu 阅读(237) 评论(0) 推荐(1) 编辑
摘要: P2885 [USACO07NOV]电话线Telephone Wire 给出若干棵树的高度,你可以进行一种操作:把某棵树增高h,花费为h*h。 操作完成后连线,两棵树间花费为高度差*定值c。 求两种花费加和最小值。 输入输出样例 输入 #1复制 5 2 2 3 5 1 4 输出 #1复制 15sol 阅读全文
posted @ 2019-07-29 22:16 yccdu 阅读(163) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 38 下一页