![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
多校
文章平均质量分 70
KinderRiven
这个作者很懒,什么都没留下…
展开
-
【HDU】2818-Building Block(并查集)
坑死了,这道题QAQ。。。说好的没有0,但是后台数据有0,WA了一下午= = 利用num[i]代表i下面有几个格子,Size[i]代表i做底的时候这一堆有几个箱子 #include #include using namespace std; const int maxn = 30005; int n,fa[maxn]; int num[maxn],Size[maxn]; char op[5];原创 2015-06-04 16:22:12 · 528 阅读 · 0 评论 -
【HDU】2817-A sequence of numbers(快速幂)
对于两种序列一种等比,一种等差 如果是等比 ak = a1 + (k - 1) * d 直接用((a1 * mod) + ((k - 1) % mod) * (d % mod)) % mod求就可以了 如果是等差 ak = a1 * q ^(k - 1) 利用快速幂求出q ^(k - 1)可以得到结果 #include #include #include #include using nam原创 2015-06-04 13:55:07 · 664 阅读 · 0 评论