2014年8月4日
摘要: 离散化+RMQ。离散化存储每个数出现的次数,再RMQ查询max次数。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int maxn=100005; 7 8 int count[maxn]; 9 int ... 阅读全文
posted @ 2014-08-04 18:44 gfc 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 树状数组枚举裁判位置,设裁判为第i 个人,左边有l[i]个比他小的选手,右边有r[i]个比他小的选手;令c[i]表示技能值为i 的人是否存在,计算l[i] 即c[1]~c[i-1]的和,计算l[i]后使c[a[i]]=1;同理求r[i]; 1 #include 2 #include 3 #inc... 阅读全文
posted @ 2014-08-04 16:43 gfc 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 开始用vector模拟,用一个迭代器its来保存当前光标位置,写完发现insert可能复杂度有点高还是什么的,tle了。。。后来用另一个方法,从后往前遍历,用一个数r 来表示每次光标移到前面后再次移动的位置(可能说的不是很清楚,具体看代码吧。。。囧rz)每次碰到'['则输出从'['到r 的字符并标记... 阅读全文
posted @ 2014-08-04 14:51 gfc 阅读(173) 评论(0) 推荐(0) 编辑
摘要: STL数据结构(vector,map)基本操作 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 int main (){10 int n,m... 阅读全文
posted @ 2014-08-04 10:27 gfc 阅读(136) 评论(0) 推荐(0) 编辑
摘要: STL数据结构(queue,stack,priority queue)的基本操作; 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 8 9 int main (){10 int n;1... 阅读全文
posted @ 2014-08-04 09:20 gfc 阅读(111) 评论(0) 推荐(0) 编辑