随笔分类 -  HDU

摘要:/* hdu 2857 Mirror and Light 计算几何 镜面反射 */ #include #include #include #include using namespace std; const double DNF=100000001.0; int t; double x1,x2,y11,y2,xs,ys,xe,ye; struct Point { double x; ... 阅读全文
posted @ 2017-03-08 20:33 BBBob 阅读(174) 评论(0) 推荐(0)
摘要:/* HDU4869 http://acm.hdu.edu.cn/showproblem.php?pid=4869 费马小定理+快速幂 求逆元 暴力组合数 奇偶性 */ #include #include using namespace std; const __int64 Nmax=100005LL; const __int64 mod=1000000009LL; __int64 fac[... 阅读全文
posted @ 2017-03-08 20:31 BBBob 阅读(151) 评论(0) 推荐(0)
摘要:/* HDU 4861 Couple doubi http://acm.hdu.edu.cn/showproblem.php?pid=4861 打表找规律 * */ #include #include using namespace std; const int Nmax=100005; int k,p; int num[Nmax]; int pow(int base,int n) ... 阅读全文
posted @ 2017-03-08 20:24 BBBob 阅读(139) 评论(0) 推荐(0)
摘要:/* hdu4913 Least common multiple http://acm.hdu.edu.cn/showproblem.php?pid=4913 离散化 线段树 统计逆序数思想 tips: 1、线段树中一定要到处都取模,否则wa。。。 2、lazy是乘积的形式出现,不是加和 */ #include #include #include using namespace std;... 阅读全文
posted @ 2017-03-08 20:20 BBBob 阅读(207) 评论(0) 推荐(0)
摘要:/* HDU 4911 ( Inversion ) http://acm.hdu.edu.cn/showproblem.php?pid=4911 线段树求逆序数 离散化 离散化 离散化! 重要的事情说三遍 嘤嘤嘤 */ #include #include #include using namespace std; const long long Nmax=1000005; long lo... 阅读全文
posted @ 2017-03-08 20:19 BBBob 阅读(199) 评论(0) 推荐(0)
摘要:点我看题 初步想法是模拟,找到下一个位置并记录操作数,O(n^2)肯定会超时。 那么进行优化,会发现到下一位置的操作数就是两个位置之间存在的数的个数,于是就变成了计数问题。 不难想到用树状数组或线段树进行计数,时间复杂度O(nlogn)。 阅读全文
posted @ 2016-10-22 01:11 BBBob 阅读(222) 评论(0) 推荐(0)
摘要:题目地址 二分图最大匹配,将1-n分为二分图的一边,编号1-n为另一边,当编号1-n中的数字加0或k的整数倍为j(j<=n)的时候将编号i与j相连。 如此,这个二分图中如果最大匹配数为n,则Jerry赢,否则Tom赢。 阅读全文
posted @ 2016-10-13 01:14 BBBob 阅读(179) 评论(0) 推荐(0)
摘要:题目地址 强行线段树求逆序数,不要问我为何如此作死2333333,RE了好几发,感觉自己简直智障 阅读全文
posted @ 2016-10-11 09:58 BBBob 阅读(149) 评论(0) 推荐(0)
摘要:题目地址 线段树 这题看到第一句和插图宝宝我就惊呆了23333 阅读全文
posted @ 2016-10-11 08:27 BBBob 阅读(150) 评论(0) 推荐(0)
摘要:题目地址 欧拉函数+矩阵快速幂 阅读全文
posted @ 2016-10-07 01:28 BBBob 阅读(174) 评论(0) 推荐(0)
摘要:题目地址 manacher 阅读全文
posted @ 2016-10-07 01:24 BBBob 阅读(236) 评论(0) 推荐(0)
摘要:题目地址 manacher 阅读全文
posted @ 2016-10-07 01:22 BBBob 阅读(156) 评论(0) 推荐(0)
摘要:题目地址 AC自动机模板 阅读全文
posted @ 2016-10-07 01:19 BBBob 阅读(138) 评论(0) 推荐(0)
摘要:题目地址 线段树 阅读全文
posted @ 2016-10-07 01:15 BBBob 阅读(141) 评论(0) 推荐(0)
摘要:题目地址 线段树 阅读全文
posted @ 2016-10-07 01:11 BBBob 阅读(142) 评论(0) 推荐(0)