摘要: Codeforces 1107一题除了dp做法还有二分带权匹配O(n^3)做法,国外网友的板子时间非常优秀,但矩阵设定的事情并不是很懂…… C++ //Codeforces 1107F const int maxn = 505; int n; ll a, b, k, Matrix[maxn][max 阅读全文
posted @ 2019-04-09 23:39 AlphaWA 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 题目传送 做法 对于每个人,inc为x,pref为y;对于每道菜,p和s为x,b为y 于是根据题意有$$p[i] include include include include define rep(i, a, b) for (int i = a; i void read(T &x) { x = 0 阅读全文
posted @ 2019-04-09 20:25 AlphaWA 阅读(299) 评论(0) 推荐(0) 编辑
摘要: pi只有0~5000且只找最小的没出现的,又要找不同club的,考虑二分匹配,左边pi,右边ci,一个匹配一个。离线倒着加边即可。 阅读全文
posted @ 2019-04-09 14:29 AlphaWA 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 题目传送 推公式博客传送 推完式子就是去朴素地求就行了Orz C++ const int maxn = 1e5 + 5; const int mod = 1e9 + 7; int m, mu[maxn], vis[maxn], primes[maxn], tot; ll dp[maxn]; vect 阅读全文
posted @ 2019-04-09 11:18 AlphaWA 阅读(198) 评论(0) 推荐(0) 编辑