摘要: 签到题都要想一会 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 #define MOD 100000000710 const int INF=... 阅读全文
posted @ 2015-07-27 22:55 miao_a_miao 阅读(134) 评论(0) 推荐(0)
摘要: 题意:有一幅图,现在要加一条边,加边之后要你删除一条边,使图不连通,费用为边的费用,要你求的是删除的边的最小值的最大值(每次都可以删除一条边,选最小的删除,这些最小中的最大就为答案)首先要进行缩点,把图缩为一棵树,因此,加入一条边后图就会存在一个环,环中的任何一条边删除后都不会导致图不连通之后找一条... 阅读全文
posted @ 2015-07-27 22:31 miao_a_miao 阅读(140) 评论(0) 推荐(0)
摘要: 题意:一个长为L的河,中间有n个石子,小青蛙需要跳少于m次过河,判断小青蛙每次跳跃最大距离的最小值最大值最小,用二分Sample Input6 1 2225 3 311218Sample Output4112015-07-27:备战区域赛专题 1 #include 2 #include 3 #inc... 阅读全文
posted @ 2015-07-27 17:16 miao_a_miao 阅读(147) 评论(0) 推荐(0)
摘要: 题意:求K个机器人从同一点出发,遍历所有点所需的最小花费链接:点我Sample Input3 1 1 //3个点,从1出发,1个机器人1 2 11 3 13 1 21 2 11 3 1Sample Output32转移方程: dp[i][j]=min(dp[i][j],dp[i][j*k],d... 阅读全文
posted @ 2015-07-27 17:14 miao_a_miao 阅读(121) 评论(0) 推荐(0)
摘要: 题意:求1-n内最大的x/phi(x)通式:φ(x)=x*(1-1/p1)*(1-1/p2)*(1-1/p3)*(1-1/p4)…..(1-1/pn),其中p1, p2……pn为x的所有质因数,x是不为0的整数。φ(1)=1(唯一和1互质的数就是1本身)。因此含质因数最多的即为所求,打表求出前n个积... 阅读全文
posted @ 2015-07-27 17:14 miao_a_miao 阅读(197) 评论(0) 推荐(0)
摘要: 题意:给一些指定长宽高的砖,求能累出的最大高度,不同砖有不同编号,每种编号对下面的砖做出了限制dp注意输出要用%I64d,否则会wa,以后不用%lld了Sample Input310 10 12 010 10 12 110 10 11 2210 10 11 110 10 11 10Sample Ou... 阅读全文
posted @ 2015-07-27 16:58 miao_a_miao 阅读(188) 评论(0) 推荐(0)
摘要: 一看正确率这么高,以为是水题可以爽一发,结果是没怎么用过的矩阵快速幂,233题解链接:点我 1 #include 2 #include 3 const int N=10; 4 using namespace std; 5 int k,m; 6 struct Matrix{ 7 int map... 阅读全文
posted @ 2015-07-27 16:08 miao_a_miao 阅读(130) 评论(0) 推荐(0)
摘要: 模板题 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define lson l,mid,rt>1) 11 #define ll long long 12 #define cl(a) memse... 阅读全文
posted @ 2015-07-27 15:49 miao_a_miao 阅读(153) 评论(0) 推荐(0)
摘要: stl的操作不是很熟练, 记录一下 map map默认是按照key从大到小排序的 从小到大排序,加个greater<int> erase vector: lower_bound and upper_bound copy resize(int n, int val=0) 如果n比原size大,那么会默 阅读全文
posted @ 2015-07-27 14:18 miao_a_miao 阅读(380) 评论(0) 推荐(0)