摘要: 题目就是一个rmq算法的典型应用,关键是将其转化成rmq的形式,因为每个点都是a[i]<=a[i+1]所以对于每一个点记录他的左边与右边,因而可知他的长度(即出现的频率),然后还有一个值记录频率;最后求解是用的很巧妙的方法;View Code #include <iostream>#include <cstdio>#include <cmath>using namespace std;const int max_s = 100007;int f[25][max_s],hash[max_s],pow2[25],a[max_s];struct node{ 阅读全文
posted @ 2011-12-04 11:25 E_star 阅读(224) 评论(0) 推荐(0)
摘要: http://codeforces.com/contest/133悲剧啊。。又掉了rating。。越做越往下衰了啊。。呜呜。。看着队友们都三道题而且A的时间还很早。自己感觉到了很大的压力,总之要努力啊。。加油。。。A:http://codeforces.com/contest/133/problem/AYou have to figure out whether executing this program will produce any output.人家明明说了是否处理输出,自己还尝试各种情况,结果wa三次才过。B:http://codeforces.com/contest/133/pr 阅读全文
posted @ 2011-12-04 09:43 E_star 阅读(217) 评论(0) 推荐(0)