摘要: #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<complex> #include<vector> #include<deque> using namespace std; typedef 阅读全文
posted @ 2018-08-28 16:34 GoesOn 阅读(438) 评论(0) 推荐(0) 编辑
摘要: HDU2586 纯LCA模板 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #define lowbit(x) x&(-x) #define rep(i,l,r) for(int i=l;i<=r;++i 阅读全文
posted @ 2018-08-20 10:52 GoesOn 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 两种,不知道两种谁快。。。 inline char nc() { static char buf[100000], *p1 = buf, *p2 = buf; return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 阅读全文
posted @ 2018-08-13 20:09 GoesOn 阅读(213) 评论(0) 推荐(0) 编辑
摘要: int l=0,r=maxn-1; int ans=-1; while(l<=r) { int mid=(l+r)/2; if(check(mid)) { ans=mid; r=mid-1; } else { l=mid+1; } } if(ans 1) printf("Not Find!\n"); 阅读全文
posted @ 2018-08-13 09:13 GoesOn 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Orz发现之前的版子有小错误都不知道怎么在用2333 8.8更新多边形计算+求直线交点 顺便把之前版子统一了一下 希望这周解决计算几何 然后就不用再看模板了 忘记加重载 / 了。。 更了另一个求交点情况,不会有除0情况出现 #include<cstdio> #include<cstring> #in 阅读全文
posted @ 2018-08-08 10:34 GoesOn 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 佩尔方程最基本的形式(我目前了解到的): x2 - d × y2 = 1 首先找到一组最小正整数解:(x1,y1) 解的递推式为: Xn = Xn-1 × X1 + d × Yn-1 ×Y1 Yn = Xn-1 × Y1 + Yn-1 × X1 矩阵快速幂递推: 例题:佩尔方程+矩阵快速幂(HDU3 阅读全文
posted @ 2018-08-06 11:02 GoesOn 阅读(475) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<set> #include <vector> #include <string> #include <iostream> using nam 阅读全文
posted @ 2018-08-05 10:57 GoesOn 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 资料: 求逆序对:https://blog.csdn.net/ssimple_y/article/details/53744096 离散化:https://blog.csdn.net/xiangaccepted/article/details/73276826 一、离散化+求逆序对数 //a[i] 阅读全文
posted @ 2018-08-01 11:01 GoesOn 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 一、区间覆盖(将某个区间的所有值变为某个值)+区间查询(求区间和) 题目:HDU1698 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #define lowbit(x) x&(-x) #define r 阅读全文
posted @ 2018-08-01 10:48 GoesOn 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 typedef long long ll; 8 const int maxn = 1e3+10; 9 const double INF = 0x3f3f3f3f; 10 const doub... 阅读全文
posted @ 2018-07-27 08:41 GoesOn 阅读(524) 评论(0) 推荐(0) 编辑