![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
usaco
Wolfycz
这个作者很懒,什么都没留下…
展开
-
[Usaco2009 Feb]庙会捷运Fair Shuttle
Description 公交车一共经过N(1<=N<=20000)个站点,从站点1一直驶到站点N。K(1<=K<=50000)群奶牛希望搭乘这辆公交车。第i群牛一共有Mi(1<=Mi<=N)只.他们希望从Si到Ei去。 公交车只能座C(1<=C<=100)只奶牛。而且不走重复路线,请计算这辆车最多能满足多少奶牛听要求。 注意:对于每一群奶牛,可以部分满足,也可以全部满足,也可以全部不满足。In原创 2017-09-25 20:07:33 · 342 阅读 · 2 评论 -
[Usaco2013 Jan]Island Travels
DescriptionFarmer John has taken the cows to a vacation out on the ocean! The cows are living on N (1 <= N <= 15) islands, which are located on an R x C grid (1 <= R, C <= 50). An island is a maximal c原创 2017-11-13 15:57:57 · 268 阅读 · 0 评论 -
[Usaco2008 Dec]Hay For Sale 购买干草
Description 约翰遭受了重大的损失:蟑螂吃掉了他所有的干草,留下一群饥饿的牛.他乘着容量为C(1≤C≤50000)个单位的马车,去顿因家买一些干草. 顿因有H(1≤H≤5000)包干草,每一包都有它的体积Vi(l≤Vi≤C).约翰只能整包购买,他最多可以运回多少体积的干草呢?Input 第1行输入C和H,之后H行一行输入一个Vi.Output 最多的可买干草体积.Sample In原创 2017-09-25 17:17:13 · 227 阅读 · 0 评论 -
[Usaco2017 Feb]Why Did the Cow Cross the Road III
Description给定长度为2N的序列,1~N各处现过2次,i第一次出现位置记为ai,第二次记为bi,求满足ai < aj < bi < bj的对数Sample Input432441321Sample Output3HINTN<=100000树状数组维护,一个数出现第一次就加入树状数组,出现第二次的时候统计有多少个数出现一次,并把当前数去掉。记得倒着加入#include<cmath>#inc原创 2017-11-13 15:43:46 · 304 阅读 · 0 评论 -
[Usaco2017 Feb]Why Did the Cow Cross the Road II
Description上下有两个长度为n、位置对应的序列A、B,其中数的范围均为1~n。若abs(A[i]-B[j])<= 4,则A[i]与B[j]间可以连一条边。现要求在边与边不相交的情况下的最大的连边数量。n <= 10^3Sample Input6123456654321Sample Output5网上有题解说求最长公共上升序列,一脸懵逼,反正我只会DP。设f[i][j]表示A序列选到第i个,原创 2017-11-13 15:36:08 · 302 阅读 · 0 评论 -
[Usaco2017 Feb]Why Did the Cow Cross the Road
Description有一幅n*n的方格图,n <=100,每个点上有一个值。从(1,1)出发,走到(n,n),只能走上下左右。每走一步花费t,每走三步需要花费走完三步后到达格子的值。求最小花费的值。Sample Input4 230 92 36 1038 85 60 1641 13 5 6820 97 13 80Sample Output31这题有两种思想,可以强行上一个三维广搜,不过我们也可以强原创 2017-11-13 15:11:39 · 297 阅读 · 0 评论 -
[Usaco2017 Open]Modern Art 2
DescriptionHaving become bored with standard 2-dimensional artwork (and also frustrated at others copying her work), the great bovine artist Picowso has decided to switch to a more minimalist, 1-dimens原创 2017-11-13 14:57:04 · 641 阅读 · 0 评论 -
[Usaco2006 Jan] Dollar Dayz 奶牛商店
Description约翰到奶牛商场里买工具.商场里有K(1≤K≤100).种工具,价格分别为1,2,…,K美元.约翰手里有N(1≤N≤1000)美元,必须花完.那他有多少种购买的组合呢?InputA single line with two space-separated integers: N and K. 仅一行,输入N,K.OutputA single line with a singl原创 2017-11-13 14:28:28 · 343 阅读 · 0 评论 -
[Usaco2006 Mar]Mooo 奶牛的歌声
DescriptionFarmer John’s N (1 <= N <= 50,000) cows are standing in a very straight row and mooing. Each cow has a unique height h in the range 1..2,000,000,000 nanometers (FJ really is a stickler for p原创 2017-11-12 20:01:18 · 390 阅读 · 0 评论 -
[Usaco2006 Nov]Bad Hair Day 乱发节
Description 农民John的某 N 头奶牛 (1 <= N <= 80,000) 正在过乱头发节!由于每头牛都意识到自己凌乱不堪的发型,FJ 希望统计出能够看到其他牛的头发的牛的数量。 每一头牛 i有一个高度 h[i] (1 <= h[i] <= 1,000,000,000)而且面向同一方向排成一排。第i头牛可以看到第i+1,i+2头牛,只要他们的高度严格小于第i头牛,并且中间没有其原创 2017-11-12 19:33:51 · 308 阅读 · 0 评论 -
[Usaco2006 Open]County Fair Events 参加节日庆祝
DescriptionFarmer John has returned to the County Fair so he can attend the special events (concerts, rodeos, cooking shows, etc.). He wants to attend as many of the N (1 <= N <= 10,000) special events原创 2017-11-12 19:07:32 · 291 阅读 · 0 评论 -
[Usaco2006 Open]The Climbing Wall 攀岩
DescriptionOne of the most popular attractions at the county fair is the climbing wall. Bessie wants to plan her trip up the wall in advance and needs your help. The wall is 30,000 millimeters wide and原创 2017-11-12 19:00:57 · 360 阅读 · 0 评论 -
[Usaco2005]Part Acquisition
DescriptionThe cows have been sent on a mission through space to acquire a new milking machine for their barn. They are flying through a cluster of stars containing N (1 <= N <= 50,000) planets, each w原创 2017-11-12 18:51:40 · 267 阅读 · 0 评论 -
[Usaco2005 Feb]Feed Accounting 饲料计算
DescriptionFarmer John is trying to figure out when his last shipment of feed arrived. Starting with an empty grain bin, he ordered and received F1 (1 <= F1 <= 1,000,000) kilograms of feed. Regrettably原创 2017-11-12 18:41:28 · 307 阅读 · 0 评论 -
[Usaco2005 Dec]Knights of Ni 骑士
DescriptionBessie is in Camelot and has encountered a sticky situation: she needs to pass through the forest that is guarded by the Knights of Ni. In order to pass through safely, the Knights have dema原创 2017-11-12 18:34:45 · 310 阅读 · 0 评论 -
[Usaco2008 Feb]Eating Together麻烦的聚餐
Description 为了避免餐厅过分拥挤,FJ要求奶牛们分3批就餐。每天晚饭前,奶牛们都会在餐厅前排队入内,按FJ的设想所有第3批就餐的奶牛排在队尾,队伍的前端由设定为第1批就餐的奶牛占据,中间的位置就归第2批就餐的奶牛了。由于奶牛们不理解FJ的安排,晚饭前的排队成了一个大麻烦。 第i头奶牛有一张标明她用餐批次D_i(1 <= D_i <= 3)的卡片。虽然所有N(1 <= N <= 30,0原创 2017-09-28 22:06:18 · 259 阅读 · 0 评论 -
[Usaco2008 Dec]Patting Heads 轻拍牛头
Description 今天是贝茜的生日,为了庆祝自己的生日,贝茜邀你来玩一个游戏. 贝茜让N(1≤N≤100000)头奶牛坐成一个圈.除了1号与N号奶牛外,i号奶牛与i-l号和i+l号奶牛相邻.N号奶牛与1号奶牛相邻.农夫约翰用很多纸条装满了一个桶,每一张包含了一个独一无二的1到1,000,000的数字. 接着每一头奶牛i从柄中取出一张纸条Ai.每头奶牛轮流走上一圈,同时拍打所有编号能整除在原创 2017-09-27 15:05:09 · 314 阅读 · 0 评论 -
[Usaco2011 Feb]Generic Cow Protests
DescriptionFarmer John’s N (1 <= N <= 100,000) cows are lined up in a row and numbered 1..N. The cows are conducting another one of their strange protests, so each cow i is holding up a sign with a原创 2017-11-13 18:57:14 · 312 阅读 · 0 评论