上一页 1 ··· 22 23 24 25 26
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1179 【题解】 tarjan缩强联通分量然后直接spfa上就行啦! 好久没写得这么畅快一遍过了qwq # include <queue> # include <stdio.h> # inclu 阅读全文
posted @ 2017-04-26 15:57 Galaxies 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4869 【题解】 发现好像没有办法普通维护。 给小盆友们江数论的时候江过x^m mod p = x^(m mod phi(p)) mod p upd: 这篇文章写的时候我也不知道我自己怎么想的了 阅读全文
posted @ 2017-04-25 22:21 Galaxies 阅读(1443) 评论(2) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4870 【题解】 题目给了提示了:组合意义 题目转化为从nk个物品中选出模k余r个数的方案数。 f[i,j]表示前i个物品选出模k余j个数的方案数。 矩乘即可。 # include <stdio 阅读全文
posted @ 2017-04-25 20:39 Galaxies 阅读(604) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4004 【题解】 这种题目怎么这么眼熟呢?似乎这样的都能贪心。 按照物品价格从小到大排序,然后贪心插入。 插入的时候消元即可(线性基思想) 卡精度啊qwq # include <math.h> 阅读全文
posted @ 2017-04-25 18:46 Galaxies 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4008 【题解】 我们把牌看成人吧好说明qwq f[i,j]表示第i个人得到了j次机会的概率。 f[i,j]=f[i-1,j]*(1-p[i-1])^j+f[i-1,j+1]*(1-(1-p[i 阅读全文
posted @ 2017-04-25 18:43 Galaxies 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4584 【题解】 令f[i,j,k]表示前i个学校,赛艇最远放在j区间,且j这个区间放了k个赛艇。 那么显然区间可以离散(这里用左闭右开方便),那么就是一个大概O(n^3)的做法了。 好像就行了 阅读全文
posted @ 2017-04-25 18:34 Galaxies 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1177 【题解】 发现分割方案就只有6种…… 稍微分点类,然后大力算出以(i,j)为左上角/左下角/右上角/右下角的二维前缀/后缀内的max正方形即可。 然后大力分六种情况讨论一波,注意边界。 阅读全文
posted @ 2017-04-25 15:17 Galaxies 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 退役计划 阅读全文
posted @ 2017-04-25 11:40 Galaxies 阅读(142) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26