摘要: weak nodeTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65535/32768K (Java/Other)Problem DescriptionCountry C preparing to attack Country J, but the shortage of troops Country C, Country C to find out the location of weak Country J defense.InputLine 1: n m(1<=n<=100,000, 1<=m<=120,0 阅读全文
posted @ 2012-08-24 19:33 Wheat″ 阅读(216) 评论(0) 推荐(0)
摘要: 题意:一个有n个元素的数组num[],求所有num[i]~num[i+k]的最小值和最大值。RMQ 算法小心空间,很容易被卡到可以用线段树做,每个结点保存该线段的最大/小值...然后简单查询最大最小值即可RMQ:View Code 1 //Accepted 8008K 6110MS C++ 1577B 超卡空间 2 #include <cstdio> 3 #include <string> 4 #include <cmath> 5 #include <algorithm> 6 using namespace std; 7 const int MA 阅读全文
posted @ 2012-08-24 19:23 Wheat″ 阅读(758) 评论(0) 推荐(0)