
二分
cyendra
Azarath Metrion Zinthos
展开
-
UVALive 4513 Stammering Aliens 字符串Hash求LCS
DescriptionDr. Ellie Arroway has established contact with an extraterrestrial civilization. However, all efforts to decode their messages have failed so far because, as luck would have it, the原创 2013-08-27 20:45:46 · 852 阅读 · 0 评论 -
【专题】二分搜索
【序】二分用的一点不熟,做个专题好了。---------------------一、从有序数组中查找某个值---------------------二、假定一个解并判断是否可行1、POJ1064有N条绳子长度为Li。从中切割出K条长度相同的绳子,求这K条绳子最长能有多长。const int maxn=11111;int n,k;double原创 2013-08-04 20:09:24 · 940 阅读 · 0 评论 -
UVA 1335 Beijing Guards 二分贪心
--------const int maxn=110000;const int maxm=10000;int n;int a[maxn];int lb[maxn],rb[maxn];bool C(int x){ lb[0]=a[0]; rb[0]=0; for (int i=1;i<n;i++){ if (i&1){ i原创 2014-01-08 01:40:03 · 610 阅读 · 0 评论 -
hdu 4080 Stammering Aliens 二分 hash
POJ 3882 TLE 需后缀数组------------const int SEED = 13331;const int MAX_N = 50000 + 10;char s[MAX_N];struct HASH{ ULL H[MAX_N]; ULL XL[MAX_N]; int len; HASH(){} void build(char *原创 2014-01-11 21:26:14 · 928 阅读 · 0 评论 -
POJ 2785 4 Values whose Sum is 0 二分
---------------const int maxn=4100;const int maxm=10000;int n,m;int a[4][maxn];int b[maxn*maxn];int main(){ while (~scanf("%d",&n)){ for (int i=0;i<n;i++){ for (int k=0;k<4原创 2014-01-11 23:05:29 · 624 阅读 · 0 评论 -
ZOJ 3278 8G Island 二分+二分
第K大,不是第K小啊 (╯‵□′)╯︵┻━┻----------int n,m;LL K;LL a[maxn],b[maxn];bool C(LL x){ LL res=0; for (int i=1;i<=n;i++) { int l=1,r=m; LL ans=0; while (l<=r){原创 2014-01-12 17:42:35 · 738 阅读 · 0 评论 -
ZOJ 3279 Ants 二分树状数组
----------const int maxn=110000;const int maxm=10000;int n,m;struct BIT{ int n; int tree[maxn]; void init(int n){ this->n=n; memset(tree,0,sizeof(tree)); } int原创 2014-01-12 20:38:14 · 648 阅读 · 0 评论