
USCAO
文章平均质量分 85
剑不飞
时刻思考,找准方向,坚定执行,永不服输(AC才是王道。)
展开
-
USCAO section 4.1 Fence Loops(最短路,最小环,5级)
Fence LoopsThe fences that surround Farmer Brown's collection of pastures have gotten out of control. They are made up of straight segments from 1 through 200 feet long that join together only a原创 2013-07-08 19:32:49 · 884 阅读 · 0 评论 -
USACO section 3.2 Factorials(dp)
FactorialsThe factorial of an integer N, written N!, is the product of all the integers from 1 through N inclusive. The factorial quickly becomes very large: 13! is too large to store in a 32-bit原创 2012-10-23 19:47:27 · 490 阅读 · 0 评论 -
USACO section 3.1 Contact(AC自动机)
ContactIOI'98 The cows have developed a new interest in scanning the universe outside their farm with radiotelescopes. Recently, they noticed a very curious microwave pulsing emission sent right f原创 2012-10-21 21:08:13 · 5938 阅读 · 0 评论 -
USACO section 3.1 Stamps(dp)
StampsGiven a set of N stamp values (e.g., {1 cent, 3 cents}) and an upper limit K to the number of stamps that can fit on an envelope, calculate the largest unbroken list of postages from 1 cent原创 2012-10-20 15:37:11 · 923 阅读 · 0 评论 -
USACO section3.1 Shaping Regions(漂浮法)
Shaping RegionsN opaque rectangles (1 <= N <= 1000) of various colors are placed on a white sheet of paper whose size is A wide by B long. The rectangles are put with their sides parallel to the s原创 2012-10-20 13:34:09 · 943 阅读 · 0 评论 -
USACO section 3.1 Humble Numbers(DP)
Humble NumbersFor a given set of K prime numbers S = {p1, p2, ..., pK}, consider the set of all numbers whose prime factors are a subset of S. This set contains, for example, p1, p1p2, p1p1, a原创 2012-10-12 18:30:36 · 509 阅读 · 0 评论 -
USACO section 3.1 Score Inflation(DP背包)
Score InflationThe more points students score in our contests, the happier we here at the USACO are. We try to design our contests so that people can score as many points as possible, and would li原创 2012-10-09 20:17:07 · 645 阅读 · 0 评论 -
USACO section 3.1 Agri-Net(最小生成树,prim)
Agri-NetRuss Cox Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.Farmer Jo原创 2012-10-08 21:10:32 · 579 阅读 · 0 评论 -
USACO section 2.4 Cow Tours(并查集+最短路)
Cow ToursFarmer John has a number of pastures on his farm. Cow paths connect some pastures with certain other pastures, forming a field. But, at the present time, you can find at least two pasture原创 2012-10-07 10:11:58 · 1324 阅读 · 0 评论 -
USACO section 2.4 Fractions to Decimals(小数处理)
Fractions to DecimalsWrite a program that will accept a fraction of the form N/D, where N is the numerator and D is the denominator and print the decimal representation. If the decimal representat原创 2012-10-07 17:47:52 · 707 阅读 · 0 评论 -
USACO section 2.4 Bessie Come Home(最短路)
Bessie Come HomeKolstad & Burch It's dinner time, and the cows are out in their separate pastures. Farmer John rings the bell so they will start walking to the barn. Your job is to figure out whic原创 2012-10-07 12:09:26 · 674 阅读 · 0 评论 -
USACO section 2.3 Controlling Companies(dfs)
Controlling CompaniesSome companies are partial owners of other companies because they have acquired part of their total shares of stock. For example, Ford owns 12% of Mazda. It is said that a com原创 2012-09-12 20:39:27 · 557 阅读 · 0 评论 -
USACO section 3.2 Stringsobits(组合数学)
StringsobitsKim Schrijvers Consider an ordered set S of strings of N (1 <= N <= 31) bits. Bits, of course, are either 0 or 1.This set of strings is interesting because it is ordered and contai原创 2012-10-24 16:58:44 · 559 阅读 · 0 评论 -
USACO section 3.2 Magic Squares(STL+广搜)
Magic SquaresIOI'96 Following the success of the magic cube, Mr. Rubik invented its planar version, called magic squares. This is a sheet composed of 8 equal-sized squares:1234原创 2012-11-03 13:58:54 · 640 阅读 · 0 评论 -
USACO section 3.2 Spinning Wheels(模拟)
Spinning Wheels1998 ACM NE Regionals Each of five opaque spinning wheels has one or more wedges cut out of its edges. These wedges must be aligned quickly and correctly. Each wheel also has an ali原创 2012-11-02 20:17:15 · 802 阅读 · 0 评论 -
USACO section 4.1 Fence Rails(搜索+优化)
Fence RailsBurch, Kolstad, and SchrijversFarmer John is trying to erect a fence around part of his field. He has decided on the shape of the fence and has even already installed the posts, but h原创 2013-04-08 21:07:56 · 719 阅读 · 0 评论 -
USACO section 3.4 Closed Fences(计算几何+叉积+二分)
Closed FencesA closed fence in the plane is a set of non-crossing, connected line segments with N corners (3 i, yi}, i in (1..N).Every pair of adjacent vertices defines a side of the fence.原创 2013-03-19 10:50:41 · 1188 阅读 · 0 评论 -
USACO section 3.4 Raucous Rockers(dp)
Raucous RockersYou just inherited the rights to N (1 <= N <= 20) previously unreleased songs recorded by the popular group Raucous Rockers. You plan to release a set of M (1 <= M <= 20) compact原创 2013-03-13 17:34:19 · 685 阅读 · 0 评论 -
USACO section 3.4 American Heritage(二叉树序列)
American HeritageFarmer John takes the heritage of his cows very seriously. He is not, however, a truly fine bookkeeper. He keeps his cow genealogies as binary trees and, instead of writing them原创 2013-03-07 15:58:02 · 645 阅读 · 0 评论 -
USACO section 3.3 A Game(DP)
A GameIOI'96 - Day 1 Consider the following two-player game played with a sequence of N positive integers (2 <= N <= 100) laid onto a game board. Player 1 starts the game. The players move alterna原创 2013-01-07 20:32:35 · 468 阅读 · 0 评论 -
USACO section3.3 Home on the Range(压缩+枚举)
Home on the RangeFarmer John grazes his cows on a large, square field N (2 <= N <= 250) miles on a side (because, for some reason, his cows will only graze on precisely square land segments). Regr原创 2013-01-06 11:52:18 · 508 阅读 · 0 评论 -
USACO section Camelot(枚举+队列优化)
CamelotIOI 98 Centuries ago, King Arthur and the Knights of the Round Table used to meet every year on New Year's Day to celebrate their fellowship. In remembrance of these events, we consider a b原创 2013-01-05 14:31:02 · 597 阅读 · 0 评论 -
USACO section 3.3 Shopping Offers(DP或最短路)
Shopping OffersIOI'95 In a certain shop, each kind of product has an integer price. For example, the price of a flower is 2 zorkmids (z) and the price of a vase is 5z. In order to attract more cus原创 2012-11-12 19:57:01 · 580 阅读 · 0 评论 -
USACO section 3.3 Riding the Fences(欧拉通路的遍历,dfs)
Riding the FencesFarmer John owns a large number of fences that must be repaired annually. He traverses the fences by riding a horse along each and every one of them (and nowhere else) and fixing原创 2012-11-05 16:13:41 · 686 阅读 · 0 评论 -
USACO section 3.2 Feed Ratios(高斯定理)
Feed Ratios1998 ACM Finals, Dan Adkins Farmer John feeds his cows only the finest mixture of cow food, which has three components: Barley, Oats, and Wheat. While he knows the precise mixture of th原创 2012-11-03 11:18:45 · 740 阅读 · 0 评论 -
USACO section 3.2 Sweet Butter(SPFA)
Sweet ButterGreg Galperin -- 2001Farmer John has discovered the secret to making the sweetest butter in all of Wisconsin: sugar. By placing a sugar cube out in the pastures, he knows the N (1 <=原创 2012-11-04 13:04:50 · 636 阅读 · 0 评论 -
USACO section 2.3 Money Systems(dp)
Money SystemsThe cows have not only created their own government but they have chosen to create their own money system. In their own rebellious way, they are curious about values of coinage. Tradi原创 2012-09-09 21:01:03 · 453 阅读 · 0 评论 -
USCAO section 2.3 Zero Sum(dfs)
Zero SumConsider the sequence of digits from 1 through N (where N=9) in increasing order:1 2 3 ... N. Now insert either a `+' for addition or a `-' for subtraction or a ` ' [blank] to run the原创 2012-09-08 20:48:16 · 707 阅读 · 0 评论 -
USACO section 2.3 Longest Prefix(dp)
Longest PrefixIOI'96 The structure of some biological objects is represented by the sequence of their constituents, where each part is denote by an uppercase letter. Biologists are interested in原创 2012-09-07 12:17:26 · 1403 阅读 · 0 评论 -
USCAO section Mother's Milk(搜索)
Mother's MilkFarmer John has three milking buckets of capacity A, B, and C liters. Each of the numbers A, B, and C is an integer from 1 through 20, inclusive. Initially, buckets A and B are empty原创 2012-08-07 14:38:22 · 782 阅读 · 0 评论 -
USCAO section 1.4 Packing Rectangles
Packing RectanglesIOI 95 The six basic layouts of four rectangles Four rectangles are given. Find the smallest enclosing (new) rectangle into which these four may be fitted without overlapping. B原创 2012-07-20 16:48:43 · 558 阅读 · 0 评论 -
USCAO section1.3 Prime Cryptarithm(感觉思路挺好)
Prime CryptarithmThe following cryptarithm is a multiplication problem that can be solved by substituting digits from a specified set of N digits into the positions marked with *. If the set of prime原创 2012-07-11 17:46:53 · 542 阅读 · 0 评论 -
USCAO section 1.3 Calf Flac
Calf FlacIt is said that if you give an infinite number of cows an infinite number of heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great palindromes原创 2012-07-11 16:04:54 · 6577 阅读 · 0 评论 -
USCAO section1.3 Barn Repair
Barn RepairIt was a dark and stormy night that ripped the roof and gates off the stalls that hold Farmer John's cows. Happily, many of the cows were on vacation, so the barn was not completely full. T原创 2012-07-10 18:47:53 · 674 阅读 · 0 评论 -
USCAO section 1.3 Mixing Milk
Mixing MilkSince milk packaging is such a low margin business, it is important to keep the price of the raw product (milk) as low as possible. Help Merry Milk Makers get the milk they need in the原创 2012-07-10 17:17:35 · 502 阅读 · 0 评论 -
USCAO section 1.2 Name That Number
Name That NumberAmong the large Wisconsin cattle ranchers, it is customary to brand cows with serial numbers to please the Accounting Department. The cow hands don't appreciate the advantage of th原创 2012-07-07 11:19:06 · 469 阅读 · 0 评论 -
USCAO section1.2 Palindromic Squares
Palindromic SquaresRob Kolstad Palindromes are numbers that read the same forwards as backwards. The number 12321 is a typical palindrome. Given a number base B (2 Print both the number and its squ原创 2012-07-04 09:39:30 · 559 阅读 · 0 评论 -
USCAO Section 1.1 Milking Cows
Milking CowsThree farmers rise at 5 am each morning and head for the barn to milk three cows. The first farmer begins milking his cow at time 300 (measured in seconds after 5 am) and ends at time原创 2012-04-27 20:46:54 · 681 阅读 · 0 评论 -
USCAO section 1.4 The Clocks
The ClocksIOI'94 - Day 2 Consider nine clocks arranged in a 3x3 array thusly: |-------| |-------| |-------| | | | | | | | |---O | |---O | | O |原创 2012-07-24 19:40:56 · 481 阅读 · 0 评论 -
USCAO section 1.4 Number Triangles(DP)
Number TrianglesConsider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that starts at the top and ends somewhere on the base原创 2012-08-09 20:24:17 · 512 阅读 · 0 评论