题目翻译不好,这里给出一份 题目背景 Awson是某国际学校信竞组的一只大佬.由于他太大佬了,于是干脆放弃了考前最后的集训,开车(他可是老司机)去度假.离开学校前,他打开地图,打算做些规划. 题目描述 他发现整个地图中有N(1<=N<=20000)个地点.对于所有的路线,指定了其中K(1<=K<=200,K<=N)个地点作为收费站.他设计了M(1<=M<=20000 )种单向的路线,第i条路线从地点Ui至Vi收费为Di(1<=Di<=10000).路线…
题目描述 有N(1 <= N <= 200)个农场,用1..N编号.航空公司计划在农场间建立航线.对于任意一条航线,选择农场1..K中的农场作为枢纽(1 <= K <= 100, K <= N). 当前共有M (1 <= M <= 10,000)条单向航线连接这些农场,从农场u_i 到农场 v_i, 将花费 d_i美元.(1 <= d_i <= 1,000,000). 航空公司最近收到Q (1 <= Q <= 10,000)个单向航行请求.…
Description Air Bovinia operates flights connecting the N farms that the cows live on (1 <= N <= 20,000). As with any airline, K of these farms have been designated as hubs (1 <= K <= 200, K <= N). Currently, Air Bovinia offers M one-way fl…
P3121 [USACO15FEB]审查(黄金)Censoring (Gold) (银的正解是KMP) AC自动机+栈 多字符串匹配--->AC自动机 删除单词的特性--->栈 所以我们先打个AC自动机模板 然后搞2个栈维护: AC自动机目前跑到字典树上的哪个点 已经跑过且没被删除的字符(答案栈) 每次碰到有结尾标记的点,就让2个栈弹出这个点所对应的单词的长度  最后输出第二个栈就行了 attention:输出答案后要换行,否则会蜜汁爆炸7pts P3121 code(P4824要稍作修改):…
4097: [Usaco2013 dec]Vacation Planning Description Air Bovinia is planning to connect the N farms (1 <= N <= 200) that the cows live on. As with any airline, K of these farms (1 <= K <= 100, K <= N) have been selected as hubs. The farms are…
题面:hihoCoder#1698 : 假期计划  组合数 题解: 题目要求是有序的排列,因此我们可以在一开始就乘上A!*B!然后在把这个序列划分成很多段. 这样的话由于乘了阶乘,所以所有排列我们都已经统计到了,因为划分段的时候乘了组合数,所以每段里面的不同排列都已经统计到了,所以就可以解决这道题了. 主要难度在与平时我们计算方案时一般都是先划分,再乘阶乘,所以如果陷入这个误区就可能做不出来了. 所以我们先枚举中间那段有多长,然后乘一下阶乘和处理划分的组合数,最后再乘一下中间这段的第一个可以放在…
P1360 [USACO07MAR]黄金阵容均衡Gold Balanced L… 题目描述 Farmer John's N cows (1 ≤ N ≤ 100,000) share many similarities. In fact, FJ has been able to narrow down the list of features shared by his cows to a list of only K different features (1 ≤ K ≤ 30). For ex…
题目描述 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 rather inappropria…
P1360 [USACO07MAR]黄金阵容均衡Gold Balanced L… 题目描述 Farmer John's N cows (1 ≤ N ≤ 100,000) share many similarities. In fact, FJ has been able to narrow down the list of features shared by his cows to a list of only K different features (1 ≤ K ≤ 30). For ex…
Description 小Ho未来有一个为期N天的假期,他计划在假期中看A部电影,刷B道编程题.为了劳逸结合,他决定先拿出若干天看电影,再拿出若干天刷题,最后再留若干天看电影.(若干代指大于0)  每天要么看电影不刷题,要么刷题不看电影:不会既刷题又看电影.并且每天至少看一部电影,或者刷一道题.现在小Ho要安排每天看哪些电影/刷哪些题目,以及按什么顺序看电影/刷题目.注意A部电影两两不同并且B道题目也两两不同,请你计算小Ho一共有多少种不同的计划方案.由于结果可能非常大,你只需要输出答案对100…