Loading

摘要: 洛谷P1495 https://www.luogu.com.cn/problem/P1495 #include<iostream> #include<string> #include<cmath> #include<cstring> #include<vector> #include<map> #i 阅读全文
posted @ 2020-02-18 20:59 MQFLLY 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 勘误: 多重集的组合 (1) (2) 答案应为C(n+r-1,r-1) 阅读全文
posted @ 2020-02-18 19:07 MQFLLY 阅读(119) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<string> #include<cmath> #include<cstring> #include<vector> #include<map> #include<set> #include<algorithm> #include<queue> 阅读全文
posted @ 2020-02-18 11:11 MQFLLY 阅读(176) 评论(0) 推荐(0) 编辑
摘要: k个数的公约数的含义是这k个数中均含有某个因数, 因此我们只需把所有数的因数求出来,发现有k个数均含有某个因数,那么这个数必然是这k个数的公约数 因此此题的思路就是求出每个数的因子,并存储每个因子出现的次数。最后搜索这个数组就行 题目还保证了单调性 #include<iostream> #inclu 阅读全文
posted @ 2020-02-17 20:40 MQFLLY 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 求因子数一定的最小数(反素数) #include<iostream> #include<string> #include<cmath> #include<cstring> #include<vector> #include<map> #include<set> #include<algorithm> 阅读全文
posted @ 2020-02-16 13:14 MQFLLY 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 抄的题解,主要在于联想到把通路看成连通块,每个点的答案就是所在连通块的大小 用到技巧:二维坐标变为一维的映射 #include<iostream> #include<string> #include<cmath> #include<cstring> #include<vector> #include 阅读全文
posted @ 2020-02-15 19:49 MQFLLY 阅读(112) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<string> #include<cmath> #include<cstring> #include<vector> #include<map> #include<set> #include<algorithm> #include<queue> 阅读全文
posted @ 2020-02-14 20:17 MQFLLY 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 复杂度O(NlogN) 求逆序对: #include<iostream> #include<cstdio> #include<string> #include<algorithm> #include<queue> #include<deque> #include<set> #include<map> 阅读全文
posted @ 2020-02-12 18:08 MQFLLY 阅读(97) 评论(0) 推荐(0) 编辑
摘要: inline int read() { char ch, c=' '; int res; while (ch = getchar(), ch < '0' || ch>'9') c = ch; res = ch - 48; while (ch = getchar(), ch >= '0' && ch 阅读全文
posted @ 2020-02-12 14:23 MQFLLY 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 算不出的等式 BJOI2012 看到这题 真没什么办法 无奈看题解 1.注意到p/q 联想到斜率 2.注意到 [ ] 联想到整点 注意到k在变化,构造一次函数 f(x)=p/q*x ,g(x)=q/p*x 收到【】 的影响,y值即为f(x)下取整后的值,即垂线上整点的个数 又考虑到p==q时 需特判 阅读全文
posted @ 2020-02-11 17:44 MQFLLY 阅读(165) 评论(0) 推荐(0) 编辑