Loading

随笔分类 -  ACM题解

上一页 1 ··· 14 15 16 17 18
摘要:抄的题解,主要在于联想到把通路看成连通块,每个点的答案就是所在连通块的大小 用到技巧:二维坐标变为一维的映射 #include<iostream> #include<string> #include<cmath> #include<cstring> #include<vector> #include 阅读全文
posted @ 2020-02-15 19:49 MQFLLY 阅读(120) 评论(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 阅读(100) 评论(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 阅读(173) 评论(0) 推荐(0)

上一页 1 ··· 14 15 16 17 18