USACO
文章平均质量分 72
USACO上刷的题
TRS_07170
既是程序猿也是二次猿
展开
-
2021-01-09 USACO Hamming Codes
Given N, B, and D: Find a set of N codewords (1 <= N <= 64), each of length B bits (1 <= B <= 8), such that each of the codewords is at least Hamming distance of D (1 <= D <= 7) away from each of the other codewords. The Hamming distance原创 2021-01-09 16:06:57 · 101 阅读 · 0 评论 -
2021-01-09 USACO Healthy Holsteins
Farmer John prides himself on having the healthiest dairy cows in the world. He knows the vitamin content for one scoop of each feed type and the minimum daily vitamin requirement for his cows. Help Farmer John feed the cows so they stay healthy while mini原创 2021-01-09 12:14:19 · 143 阅读 · 0 评论 -
2021-01-07 USACO Sorting a Three-Valued Sequence
Sorting is one of the most frequently performed computational tasks. Consider the special sorting problem in which the records to be sorted have at mostthreedifferent key values. This happens for instance when we sort medalists of a competition according..原创 2021-01-07 17:39:40 · 95 阅读 · 0 评论 -
2021-01-07 USACO Ordered Fractions
Consider the set of all reduced fractions between 0 and 1 inclusive with denominators less than or equal to N. Here is the set when N = 5: 0/1 1/5 1/4 1/3 2/5 1/2 3/5 2/3 3/4 4/5 1/1 Write a program that, given an integer N between 1 and 160 inclusive原创 2021-01-07 16:15:30 · 155 阅读 · 1 评论 -
2021-01-07 USACO The Castle
In a stroke of luck almost beyond imagination, Farmer John was sent a ticket to the Irish Sweepstakes (really a lottery) for his birthday. This ticket turned out to have only the winning number for the lottery! Farmer John won a fabulous castle in the Iris原创 2021-01-07 15:06:20 · 88 阅读 · 0 评论 -
2021-01-06 USACO Superprime Rib
Butchering Farmer John's cows always yields the best prime rib. You can tell prime ribs by looking at the digits lovingly stamped across them, one by one, by FJ and the USDA. Farmer John ensures that a purchaser of his prime ribs gets really prime ribs bec原创 2021-01-06 17:49:20 · 123 阅读 · 0 评论 -
2021-01-06 USACO Prime Palindromes
The number 151 is a prime palindrome because it is both a prime number and a palindrome (it is the same number when read forward as backward). Write a program that finds all prime palindromes in the range of two supplied numbers a and b (5 <= a < b &原创 2021-01-06 15:55:13 · 76 阅读 · 0 评论 -
2021-01-06 USACO Number Triangles
Consider 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. Each step can go either diagonally down to the left or diagonally down原创 2021-01-06 12:19:20 · 115 阅读 · 0 评论 -
2021-01-05 USACO Mother‘s Milk
Farmer 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 while bucket C is full of milk. Sometimes, FJ pours milk from one bucket原创 2021-01-05 20:46:00 · 157 阅读 · 0 评论 -
2021-01-05 USACO Arithmetic Progressions
An arithmetic progression is a sequence of the form a, a+b, a+2b, ..., a+nb where n=0, 1, 2, 3, ... . For this problem, a is a non-negative integer and b is a positive integer. Write a program that finds all arithmetic progressions of length n in the set原创 2021-01-05 17:16:29 · 127 阅读 · 0 评论 -
2021-01-05 USACO Ski Course Design
Farmer John has N hills on his farm (1 <= N <= 1,000), each with an integer elevation in the range 0 .. 100. In the winter, since there is abundant snow on these hills, FJ routinely operates a ski training camp. Unfortunately, FJ has just found out原创 2021-01-05 11:39:54 · 132 阅读 · 0 评论 -
2021-01-04 USACO Wormholes
Farmer John's hobby of conducting high-energy physics experiments on weekends has backfired, causing N wormholes (2 <= N <= 12, N even) to materialize on his farm, each located at a distinct point on the 2D map of his farm (the x,y coordinates are bo原创 2021-01-04 11:58:15 · 122 阅读 · 0 评论 -
2021-01-02 USACO Combination Lock
Farmer John's cows keep escaping from his farm and causing mischief. To try and prevent them from leaving, he purchases a fancy combination lock to keep his cows from opening the pasture gate. Knowing that his cows are quite clever, Farmer John wants to m原创 2021-01-02 17:04:51 · 85 阅读 · 0 评论 -
2021-01-02 USACO Prime Cryptarithm
(This poorly named task has nothing to do with prime numbers or even, really, prime digits. Sorry 'bout that.) A cryptarithm is usually presented as a pencil-and-paper task in which the solver is required to substitute a digit for each of the asterisks (o原创 2021-01-02 15:39:08 · 121 阅读 · 0 评论 -
2021-01-02 USACO Barn Repair
It 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. The cows spend the night in stalls that are arranged adjacent to ea原创 2021-01-02 12:55:10 · 73 阅读 · 0 评论 -
2021-01-01 USACO Mixing Milk
The Merry Milk Makers company buys milk from farmers, packages it into attractive 1- and 2-Unit bottles, and then sells that milk to grocery stores so we can each start our day with delicious cereal and milk. Since milk packaging is such a difficult busin原创 2021-01-01 23:33:01 · 195 阅读 · 0 评论 -
2021-01-01 USACO Dual Palindromes
A number that reads the same from right to left as when read from left to right is called a palindrome. The number 12321 is a palindrome; the number 77778 is not. Of course, palindromes have neither leading nor trailing zeroes, so 0220 is not a palindrome.原创 2021-01-01 20:17:07 · 92 阅读 · 0 评论 -
2021-01-01 USACO Palindromic Squares
Palindromes are numbers that read the same forwards as backwards. The number 12321 is a typical palindrome. Given a number base B (2 <= B <= 20 base 10), print all the integers N (1 <= N <= 300 base 10) such that the square of N is palindromic原创 2021-01-01 19:46:16 · 79 阅读 · 0 评论 -
2020-12-31 USACO Name That Number
Among 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 this filing system, though, and wish to call the members of their herd by a pl原创 2020-12-31 17:29:01 · 134 阅读 · 0 评论 -
2020-12-31 USACO Transformations
A square pattern of size N x N (1 <= N <= 10) black and white square tiles is transformed into another square pattern. Write a program that will recognize the minimum transformation that has been applied to the original pattern given the following li原创 2020-12-31 14:38:37 · 103 阅读 · 0 评论 -
2020-12-30 USACO Milking Cows
Three 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 1000. The second farmer begins at time 700 and ends at time 1200. The th原创 2020-12-31 11:46:52 · 70 阅读 · 0 评论 -
2020-12-30 USACO Broken Necklace
You have a necklace of N red, white, or blue beads (3<=N<=350) some of which are red, others blue, and others white, arranged at random. Here are two examples for n=29: 1 2 1 2 r b b r原创 2020-12-31 11:45:25 · 105 阅读 · 0 评论 -
2020-12-30 USACO Friday the Thirteenth
Is Friday the 13th really an unusual event? That is, does the 13th of the month land on a Friday less often than on any other day of the week? To answer this question, write a program that will compute the frequency that the 13th of each month lands on Su原创 2020-12-31 11:42:56 · 123 阅读 · 0 评论 -
2020-12-30 USACO Greedy Gift Givers
Task 'gift1': Greedy Gift Givers A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not give some money to some or all of the other friends (although some might be cheap and giv原创 2020-12-31 11:39:02 · 138 阅读 · 0 评论 -
2020-12-29 USACO Your Ride Is Here
/* ID: traysen1 PROG: ride LANG: C++ */ #include<iostream> #include<fstream> #include<cstring> using namespace std; const int MOD = 47; char comet[20], group[20]; int comet_number = 1, group_number = 1; int main() { ifstream fin ("r...原创 2020-12-31 11:34:04 · 67 阅读 · 0 评论