2016年12月18日

D. Green and Black Tea 贪心 + 构造

摘要: http://codeforces.com/contest/746/problem/D 首先说下一定是NO的情况。 假设a > b 那么,b最多能把a分成b + 1分,如果每份刚好是k的话,那么就最多能支持a的最大值是(b + 1) * k 其实就好比如,分成3分的话,x1 + x2 + x3 = 阅读全文

posted @ 2016-12-18 23:11 stupid_one 阅读(177) 评论(0) 推荐(0) 编辑

两点之间 这题有毒啊,不会做

摘要: https://biancheng.love/problem/640/index 一直re 不是并查集吗 #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #in 阅读全文

posted @ 2016-12-18 21:46 stupid_one 阅读(216) 评论(0) 推荐(0) 编辑

A 浪哥的烦恼 完全背包dp

摘要: https://biancheng.love/contest-ng/index.html#/131/problems 首先,去到n点的最小时间是所有数加起来。 然后,如果我1 2,然后再2--1,那么,就相当于从1继续开始,只不过是时间变化了。 所以,以后的每一步的代价都是2 * a[i] 那么设d 阅读全文

posted @ 2016-12-18 20:40 stupid_one 阅读(271) 评论(0) 推荐(0) 编辑

C. Hongcow Builds A Nation 并查集

摘要: http://codeforces.com/contest/745/problem/C 把他们并查集后, 其他没有连去government的点,全部放去同一个并查集,然后选择一个节点数最多的government集合,连接过去即可。 至于有多少条边增加,可以暴力判断。 #include <cstdio 阅读全文

posted @ 2016-12-18 10:40 stupid_one 阅读(156) 评论(0) 推荐(0) 编辑

B. Hongcow Solves A Puzzle

摘要: http://codeforces.com/contest/745/problem/B 题目要求的是,给定一个图形,要求里面判断是否有矩形,且仅有一个 就是 XXX.... XXX...X 是不行的,因为有两个了。 #include <cstdio> #include <cstdlib> #incl 阅读全文

posted @ 2016-12-18 10:26 stupid_one 阅读(244) 评论(0) 推荐(0) 编辑

导航