hardbird.net
HDU 4582 – DFS spanning tree(贪心) | HardBird
http://www.hardbird.net/hdu-4582-dfs-spanning-tree(贪心)
HDU 4582 – DFS spanning tree 贪心. 大意 对一个无向图,给定一个dfs生成树,定义T-Simple Circle 有且只有一条边不在dfs树上的环。 Define ALL(a) a.begin(), a.end(). Define clr(a, x) memset(a, x, sizeof a). Define pb push back. HDU 5352 – MZL’s City 费用流. HDU 4123 – Bob’s Race 树的直径 RMQ. WP Cumulus Flash tag cloud by Roy Tanck.
hardbird.net
HDU 6371 – Hotaru’s problem(Manacher算法) | HardBird
http://www.hardbird.net/hdu-6371-hotarus-problem(manacher算法)
HDU 6371 – Hotaru’s problem Manacher算法. 扯淡 2015多校第七场的C. 虽然是非负整数序列,但明显是要上字符串算法的题,各种不情愿做啊…最后没办法了,大帅不在,我只能单开这题了,还好最后想出正解来了,虽然最后只写完没时间debug了,不过我还是成功在赛后10分钟AC了,我想静静,但我更想大帅……. Sbegin(); it- ) { int j=*it; if( j-i)/2 ans)break; if(Ma[i] 0 & (j-i)/2 ans) { ans=(j-i) 1; break; } } } printf("Case #%d: %d n", kase, ans*3); } return 0; }. Define pb push back. Case #%d: %d n". HDU 4767 – Bell 贝尔数 矩阵快速幂 中国剩余定理. SGU 185 – Two shortest 最短路 最大流. WP Cumulus Flash tag cloud by Roy Tanck.
hardbird.net
About me | HardBird
http://www.hardbird.net/about-me
WP Cumulus Flash tag cloud by Roy Tanck.
hardbird.net
HDU 4579 – Random Walk(高斯消元) | HardBird
http://www.hardbird.net/hdu-4579-random-walk(高斯消元)
HDU 4579 – Random Walk 高斯消元. 思路 典型的高斯消元求概率dp,x[i]表示走到n需要走多少次的期望,则x[i]=sigma{p[j]*x[j]} 1.然后列矩阵,消元就好。 Define clr(a, x) memset(a, x, sizeof a). HDU 4126 – Genghis Khan the Conqueror 生成树 树链剖分. HDU 4767 – Bell 贝尔数 矩阵快速幂 中国剩余定理. WP Cumulus Flash tag cloud by Roy Tanck.
hardbird.net
HDU 4126 – Genghis Khan the Conqueror(生成树+树链剖分) | HardBird
http://www.hardbird.net/hdu-4126-genghis-khan-the-conqueror(生成树树链剖分)
HDU 4126 – Genghis Khan the Conqueror 生成树 树链剖分. 大意 在一个稠密的无向连通图中,无重边,无自环,有Q次操作,每次改变一条边的权值 只增不减 ,要求求出改变后的图的最小生成树的权值,最终输出Q次最小生成树权值的平均值。 如果改变的是生成树上的边,情况就有两种了 该边不再作为生成树上的边,需要找到权值最小替换边 该边依旧在生成树上,此次生成树的权值就是原生成树权值 边的改变量。 网上大部分的题解都是用dp来维护的替换边权值,训练赛的时候并没有想到dp,只想到树剖了……也不是什么正解,也不再多解释了,就当是保存份代码了…. Son[u] & e.v! U) ans =cost; else ans =cost-wei[v] min(query(p[v], 1, pos, 1), w); } printf("%.4f n", ans/q); } return 0; }. Define clr(a, x) memset(a, x, sizeof a). Define ls (rt 1). Define rs (ls 1). Define lson l, mid, ls.
hardbird.net
HDU 5029 Relief grain(树链剖分+线段树) | HardBird
http://www.hardbird.net/hdu-5029-relief-grain(树链剖分线段树)
HDU 5029 Relief grain 树链剖分 线段树. Query(1, 1e5, 1):0); } for(int i=1; i =n; i ) printf("%d n", ans[i]); } return 0; }. Pragma comment(linker, "/STACK:1024000000,1024000000"). Define ALL(a) a.begin(), a.end(). Define clr(a, x) memset(a, x, sizeof a). Define pb push back. Define mp make pair. Define ls (rt 1). Define rs (ls 1). Define lson l, mid, ls. Define rson mid 1, r, rs. HDU 5381 – The sum of gcd 莫队算法. HDU 5383 – Yu-Gi-Oh! WP Cumulus Flash tag cloud by Roy Tanck.
hardbird.net
HDU 5383 – Yu-Gi-Oh!(费用流 | KM最大权匹配) | HardBird
http://www.hardbird.net/hdu-5383-yu-gi-oh(费用流-km最大权匹配)
HDU 5383 – Yu-Gi-Oh! Qempty() { int u=q.front(); q.pop(); inq[u]=0; for(int i=head[u]; i; i=edge[i].nxt) { Edge& e=edge[i]; if(e.cap e.flow & d[e.v] d[u] e.cost) { d[e.v]=d[u] e.cost; p[e.v]=i; a[e.v]=min(a[u], e.cap-e.flow); if(! Inq[ev]) { q.push(e.v); inq[e.v]=1; } } } } if(d[t]= oo)return false; flow =a[t]; cost =a[t]*d[t]; int u=t; while(u! Define clr(a, x) memset(a, x, sizeof a). Tuner[i] & lev[i] lev[x]= l & atk[x] atk[i] a) { if(tuner[x]) g[x][i]=max(g[x][i], a-atk[x]-atk[i]); else g[i][x]=max(g[...
hardbird.net
HardBird | 别低头,王冠会掉。别流泪,坏人会笑。 | 第 22 页
http://www.hardbird.net/page/22
UVA 12083 – Guardian of Decency(二分图最大独立集). 题目链接 大意 一个老师要带一些学生出去玩,但带出去的任意两个学生至少[…]. UVA 11419 – SAM I AM(二分图最小点覆盖). Codeforces 514D – R2D2 and Droid Army(枚举 二分). 题目链接 大意 有n个目标站成一排,每个目标有m个属性,最多可以发动k[…]. HDU 2444 – The Accomodation of Students(二分图匹配). 题目链接 大意 n个人中,有m对相互认识的关系,问能否分成两组,同一组[…]. UVA 11478 – Halum(差分约束). UVA 11029 – Leading and Trailing. 题目链接 大意 求n k的前三位数和后三位数(输入保证答案存在)。 UVA 11865 – Stream My Contest(二分 最小树形图). UVA 10816 – Travel in Desert(二分 最短路). UVA 11183 – Teen Girl Squad(最小树形图).
hardbird.net
HDU 5381 – The sum of gcd(莫队算法) | HardBird
http://www.hardbird.net/hdu-5381-the-sum-of-gcd(莫队算法)
HDU 5381 – The sum of gcd 莫队算法. Define ALL(a) a.begin(), a.end(). Define clr(a, x) memset(a, x, sizeof a). Define pb push back. Define mp make pair. SGU 185 – Two shortest 最短路 最大流. HDU 5029 Relief grain 树链剖分 线段树. WP Cumulus Flash tag cloud by Roy Tanck.
hardbird.net
HardBird | 别低头,王冠会掉。别流泪,坏人会笑。 | 第 2 页
http://www.hardbird.net/page/2
CodeForces 593D Happy Tree Party LCA 并查集. 题目链接 题意 一个含有n个[…]. CodeForces 592D Super M 树的直径. 题目链接 题意 一棵有n个点[…]. CodeForces 575B Bribes 树链剖分. 题目链接 题意 给一个n个点[…]. UESTC 1219 – Ba Gua Zhen CCPC-E. 题目链接 题意 给一个n个点[…]. ZOJ 3911 – Prime Query 线段树. 题目链接 题意 给一个非负整[…]. HDU 5406 – CRB and Apple 费用流. 题目链接 题意 一棵树上有n个苹果,每个苹[…]. HDU 5468 – Puzzled Elena 莫比乌斯反演. 题目链接 题意 一个以结点1[…]. WP Cumulus Flash tag cloud by Roy Tanck.