首页 > TAG信息列表 > Usaco2015

[bzoj3939_Usaco2015 Feb]Cow Hopscotch(线段树维护DP)

               \;\;\;\;\;\;\; 今天晚上,想到自己的线段树专题中的题还未码完。                \;\;\;\;\;\;\;

[bzoj3887][Usaco2015 Jan]Grass Cownoisseur_trajan_拓扑排序_拓扑序dp

[Usaco2015 Jan]Grass Cownoisseur 题目大意:给一个有向图,然后选一条路径起点终点都为1的路径出来,有一次机会可以沿某条边逆方向走,问最多有多少个点可以被经过?(一个点在路径中无论出现多少正整数次对答案的贡献均为1) 数据范围:$1\le n, m\le 10^5$。 题解: 先$tarjan$缩强连通分量,因为

[Usaco2015 Feb]Censoring

A. Censoring 题目描述 Farmer John has purchased a subscription to Good Hooveskeeping magazine for his cows, so they have plenty of material to read while waiting around in the barn during milking sessions. Unfortunately, the latest issue contains a rat

BZOJ 3943: [Usaco2015 Feb]SuperBull 最小生成树

Code: // luogu-judger-enable-o2#include<bits/stdc++.h>#define setIO(s) freopen(s".in","r",stdin) #define maxn 4100000#define ll long long using namespace std;int u[maxn],v[maxn],p[3000],A[maxn]; ll arr[3000],val[maxn]; int n,ed

bzoj4391 [Usaco2015 dec]High Card Low Card

传送门 分析 神奇的贪心,令f[i]表示前i个每次都出比对方稍微大一点的牌最多能赢几次 g[i]表示从i-n中每次出比对方稍微小一点的牌最多赢几次 ans=max(f[i]+g[i+1]) 0<=i<=n 虽然方案可能会重合但是这是可行的 1:因为限制比原题目宽,所以ans>=真实的答案 2:对于重复取的数a,如果集合中有