摘要:
http://poj.org/problem?id=3368 1 #include 2 #include 3 #include 4 #include 5 #define maxn 100100 6 using namespace std; 7 8 int a[maxn],f[maxn][30],n,q,x,y,b[maxn]; 9 10 int main()11 {12 while(scanf("%d",&n)!=EOF)13 {14 if(n==0) break;15 scanf("%d",&q);16 memset(... 阅读全文
摘要:
http://poj.org/problem?id=3264 1 #include 2 #include 3 #include 4 #define maxn 5001000 5 using namespace std; 6 7 int a[maxn],x,y,N,Q,ans,max1,min1; 8 9 struct node10 {11 int l;12 int r;13 int tall;14 int shorte;15 }p[maxn];16 17 void build_tree(int i,int l,int r)18 {19 p[i]... 阅读全文