摘要: 第一道RMQ就因为vector没有清空而WA了。 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn=100000+5; 6 vector interval[maxn]; 7 int s[maxn]; 8 int value[maxn]; 9 int count[maxn];10 int num[maxn];11 int left[maxn];12 int right[maxn];13 int n,m;14 int d[maxn][100];15 int RMQ(int L,int R)16 {17 阅读全文
posted @ 2013-08-17 18:29 sooflow 阅读(191) 评论(0) 推荐(0) 编辑
摘要: //相同元素编号大较大 这么就可以避免处理有重复元素的情况。 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn=500000+5; 6 struct item 7 { 8 int num; 9 int id;10 bool operator a.id;13 return num>a.num;14 }15 }s[maxn];16 int n;17 int c[maxn];18 int lowbit(int x)19 {20 return x&-x... 阅读全文
posted @ 2013-08-17 16:08 sooflow 阅读(208) 评论(0) 推荐(0) 编辑