
RMQ
文章平均质量分 62
Napoleon2004
这个作者很懒,什么都没留下…
展开
-
HDU 5726
#include<bits/stdc++.h> using namespace std; int i,j,n,q,x,y,t,k,ans,sum,a[100000][20]; map<int,long long int>mp; int rmq(int l,int r){ int c=log10(r-l+1)/log10(2); return __gcd(a[...原创 2018-03-31 13:49:30 · 353 阅读 · 0 评论 -
POJ 2019 Cornfields
Time: 844MS Result: Accepted Source Code #include<cmath> #include<cstdio> #include<algorithm> using namespace std; int a[260][260]; int dp_min[260][260][10],dp_max[260][260][10]; i...原创 2018-03-31 13:49:18 · 225 阅读 · 0 评论 -
UVA 11235 Frequent values
#include<bits/stdc++.h> using namespace std; const int M=100010; int a[M],p[M],s[M],dp[M][20]; int rmq(int x,int y){ if(x>y)return 0; int k=log2(y-x+1); return max(dp[x][k],dp[y-(1<<...原创 2018-05-23 22:32:41 · 166 阅读 · 0 评论