
USACO
Apro1066
其他我都不想聆听 唯有我的声响除外
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[洛谷]P1596 [USACO10OCT]湖计数Lake Counting (#搜索 -1.10)
题目描述Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square conta...原创 2018-08-19 23:29:39 · 415 阅读 · 0 评论 -
[洛谷]P2722 总分 Score Inflation (#动态规划-背包)
题目背景学生在我们USACO的竞赛中的得分越多我们越高兴。我们试着设计我们的竞赛以便人们能尽可能的多得分,这需要你的帮助题目描述我们可以从几个种类中选取竞赛的题目,这里的一个"种类"是指一个竞赛题目的集合,解决集合中的题目需要相同多的时间并且能得到相同的分数。你的任务是写一个程序来告诉USACO的职员,应该从每一个种类中选取多少题目,使得解决题目的总耗时在竞赛规定的时间里并且总分最...原创 2019-01-30 18:58:09 · 378 阅读 · 0 评论 -
[洛谷]P2255 [USACO14JAN]记录奥林比克 (#贪心)
题目描述Being a fan of all cold-weather sports (especially those involving cows),Farmer John wants to record as much of the upcoming winter Moolympics as possible.The television schedule for the Mooly...原创 2019-02-16 21:37:53 · 511 阅读 · 0 评论 -
[洛谷]P1118 [USACO06FEB]数字三角形 (#搜索)
题目描述FJand his cows enjoy playing a mental game. They write down the numbers from11toN(1 \le N \le 10)N(1≤N≤10)in a certain order and then sum adjacent numbers to produce a new list with one fewe...原创 2019-03-06 13:28:52 · 301 阅读 · 0 评论 -
[洛谷]P5116 [USACO18DEC]Mixing Milk (#模拟)
题目描述农业,尤其是生产牛奶,是一个竞争激烈的行业。Farmer John 发现如果他不在牛奶生产工艺上有所创新,他的乳制品生意可能就会受到重创!幸运的是,Farmer John 想出了一个好主意。他的三头获奖的乳牛,Bessie、Elsie 和 Mildred,各自产奶的口味有些许不同,他打算混合这三种牛奶调制出完美的口味。为了混合这三种不同的牛奶,他拿来三个桶,其中分别装有三头奶牛...原创 2019-03-22 22:06:25 · 1342 阅读 · 0 评论 -
[洛谷]P2879 [USACO07JAN]区间统计Tallest Cow (#模拟)
题目描述:FarmerJohn 有n头牛,它们按顺序排成一列。 FarmerJohn 只知道其中最高的奶牛的序号及它的高度,其他奶牛的高度都是未知的。现在 FarmerJohn 手上有RR条信息,每条信息上有两头奶牛的序号(aa和bb),其中bb奶牛的高度一定大于等于aa奶牛的高度,且aa,bb之间的所有奶牛的高度都比aa小。现在FarmerJohnFarmerJohn想让你根据这些信息求出每...原创 2019-05-24 23:10:48 · 314 阅读 · 0 评论 -
[洛谷]P2853 [USACO06DEC]牛的野餐Cow Picnic (#图的遍历)
题目描述The cows are having a picnic! Each of Farmer John's K (1 ≤ K ≤ 100) cows is grazing in one of N (1 ≤ N ≤ 1,000) pastures, conveniently numbered 1...N. The pastures are connected by M (1 ≤ M ≤ 10...原创 2019-07-15 20:49:39 · 558 阅读 · 0 评论 -
[洛谷]P2937 [USACO09JAN]激光电话Laserphones (#搜索)
题意翻译题目描述The cows have a new laser-based system so they can have casual conversations while out in the pasture which is modeled as a W x H grid of points (1 <= W <= 100; 1 <= H <= 100...原创 2019-07-28 22:18:12 · 560 阅读 · 0 评论 -
[洛谷]P1649 [USACO07OCT]障碍路线Obstacle Course (#搜索)
题目描述Consider an N x N (1 <= N <= 100) square field composed of 1by 1 tiles. Some of these tiles are impassible by cows and are marked with an 'x' in this 5 by 5 field that is challenging to ...原创 2019-07-28 22:38:58 · 465 阅读 · 0 评论 -
[洛谷]P3609 [USACO17JAN]Hoof, Paper, Scissor (#记忆化搜索)
题目背景欢迎提供翻译,请直接在讨论区发帖,感谢你的贡献。题目描述You have probably heard of the game "Rock, Paper, Scissors". The cows like to play a similar game they call "Hoof, Paper, Scissors".The rules of "Hoof, Paper, S...原创 2019-07-19 21:28:36 · 507 阅读 · 0 评论 -
[洛谷]P1353 [USACO08JAN]跑步Running (#线性dp)
题目描述The cows are trying to become better athletes, so Bessie is running on a track for exactly N (1 ≤ N ≤ 10,000) minutes. During each minute, she can choose to either run or rest for the whole minu...原创 2019-07-24 23:40:48 · 266 阅读 · 0 评论 -
[洛谷]P2858 [USACO06FEB]奶牛零食Treats for the Cows (#区间dp)
题目描述FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the money he receives over a g...原创 2019-07-20 21:15:29 · 265 阅读 · 0 评论 -
[洛谷]P1172 安全逃离 (#模拟)
题目描述农夫john最近在研究如果发生重大事故,如何让农场里的奶牛逃离问题。他想要确信在紧急情况下,所有的奶牛都有一个安全逃离方案。因为在紧急情况下,奶牛们都会失去观察和判断能力,所以最近john一直在教奶牛们逃离的方法,他的方法很简单,就是任何时候都只向北方或东方逃离,北方是行坐标减1的方向,东方是列坐标加1的方向。奶牛们虽笨,不过这一点事关自己的生命,所以他们牢记在心,而且也一定会这么做。...原创 2019-07-25 22:42:09 · 1229 阅读 · 0 评论 -
[洛谷]P3146 [USACO16OPEN]248 (#区间dp)
题目描述Bessie likes downloading games to play on her cell phone, even though she doesfind the small touch screen rather cumbersome to use with her large hooves.She is particularly intrigued by the cu...原创 2019-07-22 23:00:32 · 302 阅读 · 0 评论 -
[洛谷]P2690 接苹果 (#线性dp)
题目描述很少有人知道奶牛爱吃苹果。农夫约翰的农场上有两棵苹果树(编号为1和2), 每一棵树上都长满了苹果。奶牛贝茜无法摘下树上的苹果,所以她只能等待苹果 从树上落下。但是,由于苹果掉到地上会摔烂,贝茜必须在半空中接住苹果(没有人爱吃摔烂的苹果)。贝茜吃东西很快,她接到苹果后仅用几秒钟就能吃完。每一分钟,两棵苹果树其中的一棵会掉落一个苹果。贝茜已经过了足够的训练, 只要站在树下就一定能接住这棵树...原创 2019-08-08 00:07:15 · 330 阅读 · 0 评论 -
[洛谷]P2880 [USACO07JAN]平衡的阵容Balanced Lineup (#树状数组)
题目背景题目描述:每天,农夫 John 的N(1 <= N <= 50,000)头牛总是按同一序列排队. 有一天, John 决定让一些牛们玩一场飞盘比赛. 他准备找一群在对列中为置连续的牛来进行比赛. 但是为了避免水平悬殊,牛的身高不应该相差太大. John 准备了Q (1 <= Q <= 200,000) 个可能的牛的选择和所有牛的身高 (1 <= 身高 ...原创 2019-08-09 22:15:08 · 442 阅读 · 0 评论 -
[洛谷]P2627 修剪草坪 (#线性dp+单调队列)
题目描述在一年前赢得了小镇的最佳草坪比赛后,Farm John变得很懒,再也没有修剪过草坪。现在,新一轮的最佳草坪比赛又开始了,Farm John希望能够再次夺冠。然而,Farm John的草坪非常脏乱,因此,Farm John只能够让他的奶牛来完成这项工作。Farm John有N(1 <= N <= 100,000)只排成一排的奶牛,编号为1...N。每只奶牛的效率是不同的,...原创 2019-08-20 22:12:50 · 374 阅读 · 0 评论 -
[洛谷]P2639 [USACO09OCT]Bessie的体重问题 (#动态规划-背包)
题目描述Bessie像她的诸多姊妹一样,因为从Farmer John的草地吃了太多美味的草而长出了太多的赘肉。所以FJ将她置于一个及其严格的节食计划之中。她每天不能吃多过H (5 <= H <= 45,000)公斤的干草。 Bessie只能吃一整捆干草;当她开始吃一捆干草的之后就再也停不下来了。她有一个完整的N (1 <= N <= 500)捆可以给她当作晚餐的干草的清...原创 2019-01-30 18:46:37 · 340 阅读 · 0 评论 -
[洛谷]P2888 [USACO07NOV]牛栏Cow Hurdles (#图论-最短路径)
题目描述Farmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practicing jumping over hurdles. They are getting tired, though, so they want to be able to u...原创 2019-01-29 22:27:16 · 195 阅读 · 0 评论 -
[洛谷]P1217 [USACO1.5]回文质数 (#打表 -1.2)(#数学 -2.2)
题目描述因为151既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 是回文质数。写一个程序来找出范围[a,b](5 <= a < b <= 100,000,000)( 一亿)间的所有回文质数;输入输出格式输入格式:第 1 行: 二个整数 a 和 b .输出格式:输出一个回文质数的列表,一行一个。思路正常做法是素数筛选法,...原创 2018-06-04 22:20:21 · 342 阅读 · 0 评论 -
[洛谷]P2945 [USACO09MAR]沙堡Sand Castle (#贪心 -1.8)
题目描述约翰用沙子建了一座城堡.正如所有城堡的城墙,这城墙也有许多枪眼,两个相邻枪眼中间那部分叫作“城齿”. 城墙上一共有N(1≤N≤25000)个城齿,每一个都有一个高度Mi.(1≤Mi≤100000).现在约翰想把城齿的高度调成某种顺序下的Bi,B2,…,BN(1≤Bi≤100000). -个城齿每提高一个单位的高度,约翰需要X(1≤X≤100)元;每降低一个单位的高度,约翰需要Y(1≤y...原创 2018-07-28 23:23:55 · 819 阅读 · 0 评论 -
[洛谷][USACO1.3]修理牛棚 Barn Repair (#贪心 -2.6)(#动态规划 -背包 -1.4)
题目描述在一个夜黑风高,下着暴风雨的夜晚,farmer John的牛棚的屋顶、门被吹飞了。 好在许多牛正在度假,所以牛棚没有住满。 牛棚一个紧挨着另一个被排成一行,牛就住在里面过夜。 有些牛棚里有牛,有些没有。 所有的牛棚有相同的宽度。 自门遗失以后,farmer John必须尽快在牛棚之前竖立起新的木板。 他的新木材供应商将会供应他任何他想要的长度,但是吝啬的供应商只能提供有限数目的木板。 ...原创 2018-09-02 22:47:07 · 393 阅读 · 0 评论 -
[洛谷]P2920 [USACO08NOV]时间管理Time Management (#贪心 -1.12)
题目描述Ever the maturing businessman, Farmer John realizes that he must manage his time effectively. He has N jobs conveniently numbered 1..N (1 <= N <= 1,000) to accomplish (like milking the cow...原创 2018-09-02 23:16:49 · 528 阅读 · 1 评论 -
[洛谷]P1208 [USACO1.3]混合牛奶 Mixing Milk (#贪心 -1.13)
题目描述由于乳制品产业利润很低,所以降低原材料(牛奶)价格就变得十分重要。帮助Marry乳业找到最优的牛奶采购方案。Marry乳业从一些奶农手中采购牛奶,并且每一位奶农为乳制品加工企业提供的价格是不同的。此外,就像每头奶牛每天只能挤出固定数量的奶,每位奶农每天能提供的牛奶数量是一定的。每天Marry乳业可以从奶农手中采购到小于或者等于奶农最大产量的整数数量的牛奶。给出Marry乳业每天...原创 2018-09-03 21:37:34 · 350 阅读 · 0 评论 -
[洛谷]P2983 [USACO10FEB]购买巧克力Chocolate Buying (#贪心 -1.14)
题目描述Bessie and the herd love chocolate so Farmer John is buying them some.The Bovine Chocolate Store features N (1 <= N <= 100,000) kinds of chocolate in essentially unlimited quantities. Ea...原创 2018-09-06 11:23:34 · 476 阅读 · 0 评论 -
[洛谷]P1588 丢失的牛 (#搜索 -2.6)
题目描述FJ丢失了他的一头牛,他决定追回他的牛。已知FJ和牛在一条直线上,初始位置分别为x和y,假定牛在原地不动。FJ的行走方式很特别:他每一次可以前进一步、后退一步或者直接走到2*x的位置。计算他至少需要几步追上他的牛。输入输出格式输入格式:第一行为一个整数t(≤10),表示数据组数;接下来每行包含一个两个正整数x和y(0<x,y≤10^5),分别表示FJ和牛的坐标。输...原创 2018-09-16 22:42:33 · 497 阅读 · 0 评论 -
[洛谷]P1535 游荡的奶牛 (#搜索 -2.7)
题目描述Searching for the very best grass, the cows are travelling about the pasture which is represented as a grid with N rows and M columns (2 <= N <= 100; 2 <= M <= 100). Keen observer Fa...原创 2018-09-18 23:45:40 · 798 阅读 · 0 评论 -
[洛谷]P2907 [USACO08OPEN]农场周围的道路Roads Around The Farm (#数学 -1.12)(#搜索 -1.25)
题目描述Farmer John's cows have taken an interest in exploring the territory around the farm. Initially, all N (1 <= N <= 1,000,000,000) cows commence traveling down a road in one big group. Upon ...原创 2018-10-06 23:20:41 · 419 阅读 · 0 评论 -
[洛谷]P2925 [USACO08DEC]干草出售Hay For Sale (#动态规划 -背包 -1.5)
题目描述Farmer John suffered a terrible loss when giant Australian cockroaches ate the entirety of his hay inventory, leaving him with nothing to feed the cows. He hitched up his wagon with capacity C (...原创 2018-10-19 23:39:15 · 274 阅读 · 0 评论 -
[洛谷]P1474 货币系统 Money Systems (#动态规划 -背包 -1.9)
题目描述母牛们不但创建了它们自己的政府而且选择了建立了自己的货币系统。由于它们特殊的思考方式,它们对货币的数值感到好奇。传统地,一个货币系统是由1,5,10,20 或 25,50, 和 100的单位面值组成的。母牛想知道有多少种不同的方法来用货币系统中的货币来构造一个确定的数值。举例来说, 使用一个货币系统 {1,2,5,10,...}产生 18单位面值的一些可能的方法是:18x1...原创 2018-10-20 00:00:03 · 418 阅读 · 0 评论 -
[洛谷]P2958 [USACO09OCT]木瓜的丛林Papaya Jungle (#搜索 -1.26)
题目描述Bessie has wandered off the farm into the adjoining farmer's land. He raises delicious papaya fruit, which is a delicacy for cows. The papaya jungle is partitioned into a grid of squares with R ...原创 2018-10-27 23:18:08 · 576 阅读 · 0 评论 -
[洛谷]P3056 [USACO12NOV]笨牛Clumsy Cows (#贪心 1.17)
题目描述Bessie the cow is trying to type a balanced string of parentheses into her new laptop, but she is sufficiently clumsy (due to her large hooves) that she keeps mis-typing characters. Please help ...原创 2018-10-30 22:45:18 · 528 阅读 · 0 评论 -
[洛谷]P1824 进击的奶牛 (#二分答案 -1.2)
题目描述Farmer John建造了一个有N(2<=N<=100,000)个隔间的牛棚,这些隔间分布在一条直线上,坐标是x1,...,xN (0<=xi<=1,000,000,000)。他的C(2<=C<=N)头牛不满于隔间的位置分布,它们为牛棚里其他的牛的存在而愤怒。为了防止牛之间的互相打斗,Farmer John想把这些牛安置在指定的隔间,所有牛中相...原创 2018-11-04 00:36:41 · 943 阅读 · 0 评论 -
[洛谷]P2871 [USACO07DEC]手链Charm Bracelet (#动态规划 -背包 -1.12)
题目描述Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each charm i i...原创 2018-11-04 19:28:16 · 242 阅读 · 0 评论 -
[洛谷]P2895 [USACO08FEB]流星雨Meteor Shower (#搜索 -2.10)
题目描述Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way t...原创 2018-11-08 21:51:56 · 318 阅读 · 0 评论 -
[洛谷]P4084 [USACO17DEC]Barn Painting (#树形dp)
题意翻译题意:给定一颗N个节点组成的树,3种颜色,其中K个节点已染色,要求任意两相邻节点颜色不同,求合法染色方案数。 翻译贡献者:Il_ItzABC_lI题目描述Farmer John has a large farm withNNbarns (1 \le N \le 10^51≤N≤105), some of which are already painted and some ...原创 2019-08-21 23:51:01 · 337 阅读 · 0 评论