摘要: 题目链接离线算法,以前做过一个,非常神奇。先把所有的区间,按Y排序,再按X排,然后算每一个区间,如果遇到了相同的就把前一个点更新一下-num[le],当前点插入。如果相同直接插入。再区间求和,记录结果。 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <algorithm> 5 using namespace std; 6 #define N 200001 7 #define LL __int64 8 struct node 9 {10 int x,y, 阅读全文
posted @ 2013-05-30 20:26 Naix_x 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题目链接每一个必胜点P,肯定可以走到一个N点,N点的下一步,全是P点。递推出小数据,找规律,很明显。 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 using namespace std; 5 int dp[101][101]; 6 char s1[10001],s2[10001]; 7 int main() 8 { 9 // int i,j,k,z,n,m;10 // memset(dp,-1,sizeof(dp));11 // for(i = 1;i <= 100; 阅读全文
posted @ 2013-05-30 10:21 Naix_x 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 好久没写了,单调队列。 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 using namespace std; 5 int dp[2000001],p[2000001],sum[2000001]; 6 int que[2000001]; 7 int main() 8 { 9 int n,m,i,str,end;10 scanf("%d%d",&n,&m);11 for(i = 1;i <= n;i ++)12 {13 scanf(&q 阅读全文
posted @ 2013-05-30 09:23 Naix_x 阅读(249) 评论(0) 推荐(0) 编辑