USACO
文章平均质量分 81
wawjbin
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2.1 Hamming
Hamming Codes<br />Rob Kolstad<br /> 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 codewordsis at least Hamming distance of D (1 <= D <= 7) away from each ofthe other codewords原创 2010-12-01 18:23:00 · 480 阅读 · 0 评论 -
1.3 mixing milk 简单贪心算法
Mixing Milk<br />Since milk packaging is such a low margin business, it is importantto keep the price of the raw product (milk) as low as possible. HelpMerry Milk Makers get the milk they need in the cheapest possible manner.<br />The Merry Milk Make原创 2010-10-31 13:09:00 · 813 阅读 · 0 评论 -
2.2 runround
Runaround Numbers<br /><br /> Runaround numbers are integers with unique digits, none of which iszero (e.g., 81362) that also have an interesting property, exemplifiedby this demonstration:If you start at the left digit (8 in our number) and count th原创 2010-12-21 20:52:00 · 546 阅读 · 0 评论 -
2.2 lamps
Party Lamps<br />IOI 98<br />To brighten up the gala dinner of the IOI'98 we have a set of N(10 <= N <= 100) colored lamps numbered from 1 to N.<br />The lamps are connected to four buttons:<br /> Button 1: When this button is pressed, all the lamps原创 2010-12-22 11:29:00 · 425 阅读 · 0 评论 -
今天
<br /> 现在我坐在实验室里,看书、上网、写博客。这让我想起了去年的今天,去年的今天我经历了一场重感冒,刚从医院里出来,而且还有着很大的考试压力。还好,一切都过去了。明年的今天我会是在哪里呢?<br /> 由你决定!原创 2010-12-28 10:40:00 · 346 阅读 · 0 评论 -
2.2 subset
<br />ubset Sums<br />JRM<br />For many sets of consecutive integers from 1 through N (1 <= N <= 39),one can partition the set into two sets whose sums are identical.<br />For example, if N=3, one can partition the set {1, 2, 3} in one way sothat原创 2010-12-26 20:42:00 · 584 阅读 · 0 评论 -
1.3 crypt1 简单枚举
<br />Prime Cryptarithm<br /><br />The 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 digits {2,3,5,7} is selected, the cr原创 2010-11-04 19:55:00 · 525 阅读 · 0 评论 -
1.4 ariprog
<br />暴力搜索,尽可能的提高效率<br /> Arithmetic Progressions<br /><br /> 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-negativeinteger and b is a positive integer.<br /> Write a pro原创 2010-11-05 23:04:00 · 522 阅读 · 0 评论 -
1.4 clocks 枚举
<br />注意转变思路,每个操作最多执行三次,所有解空间是4**9个,枚举所有可能的操作<br />钟表a受影响的操作有1,3,4<br />用上述方法,判断每个操作后的状态<br />输出即可<br /> <br />The Clocks<br />IOI'94 - Day 2<br />Consider nine clocks arranged in a 3x3 array thusly:<br /><br />|-------| |-------| |-------|原创 2010-11-07 21:29:00 · 417 阅读 · 0 评论 -
1.4 milk3 倒牛奶
<br />广度优先搜索,用数组记录到达过的状态<br /> <br />Mother's Milk<br /><br />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 buc原创 2010-11-08 13:12:00 · 4394 阅读 · 0 评论 -
1.5 numtri
<br />Number Triangles<br /><br />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原创 2010-11-11 13:00:00 · 450 阅读 · 0 评论 -
1.5 回文质数
Prime Palindromes<br />The number 151 is a prime palindrome because it is both a prime numberand a palindrome (it is the same number when read forward as backward).Write a program that finds all prime palindromes in the range of twosupplied numbers a原创 2010-11-12 11:38:00 · 627 阅读 · 0 评论 -
1.2 dualpal 还是进制和回文
<br />认真读题,题目要求是从2到10进制出现两次以上回文才算。<br /> <br />Dual Palindromes<br />Mario Cruz (Colombia) & Hugo Rickeboer (Argentina)<br /><br />A number that reads the same from right to left as when read from left to right is called a palindrome. The number 12321原创 2010-10-29 15:37:00 · 424 阅读 · 0 评论 -
1.3 Barn Repair 修理牛棚,还是贪心算法
<br />书读百遍,其意自见。<br /> <br />还是一道贪心算法的题目,贪心的核心就是从局部最优解推得全局最优解。<br /> <br />Barn Repair<br /><br />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 th原创 2010-10-31 14:29:00 · 1237 阅读 · 0 评论 -
2.1 holstein
<br />好久没有做题了。<br />此题的关键是组合的产生,细想一下也是可以用递归做的。<br />我使用了简单的模拟。<br /> Healthy Holsteins<br />Burch & Kolstad<br />Farmer John prides himself on having the healthiest dairy cowsin the world. He knows the vitamin content for one scoop of eachfeed type an原创 2010-12-01 12:17:00 · 413 阅读 · 0 评论 -
2.1 castle
<br />深度优先搜索The Castle<br />IOI'94 - Day 1<br /> In a stroke of luck almost beyond imagination, Farmer John wassent a ticket to the Irish Sweepstakes (really a lottery) for hisbirthday. This ticket turned out to have only the winning numberfor the l原创 2010-12-05 16:30:00 · 505 阅读 · 0 评论 -
2.1 frac1
Ordered Fractions<br /><br /> Consider the set of all reduced fractions between 0 and 1 inclusivewith denominators less than or equal to N.<br />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<br /><br /> Write a program that原创 2010-12-03 21:26:00 · 587 阅读 · 0 评论 -
2.1 sort3三值排序
Sorting a Three-Valued Sequence <br />IOI'96 - Day 2<br /> Sorting is one of the most frequently performed computational tasks.Consider the special sorting problem in which the records to be sortedhave at most three different key values. This happen原创 2010-12-03 21:27:00 · 737 阅读 · 0 评论 -
USACO 1.1 friday
统计每月13号是星期几Friday the ThirteenthIs 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 frequen原创 2010-10-24 21:30:00 · 324 阅读 · 0 评论 -
1.1 beads
<br />拾取珠子<br /><br />Broken Necklace<br /><br />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:<br /><br /> 1 2原创 2010-10-24 21:34:00 · 468 阅读 · 0 评论 -
2.2 preface
<br />好久没做题了,坚持!Preface Numbering<br /><br /> A certain book's prefaces are numbered in upper case Roman numerals.Traditional Roman numeral values use a single letter to represent acertain subset of decimal numbers. Here is the standard set:原创 2010-12-15 19:05:00 · 467 阅读 · 0 评论 -
1.1 transform 简单模拟
自己都觉得自己写的代码丑... Transformations A square pattern of size N x N (1原创 2010-10-26 23:30:00 · 349 阅读 · 0 评论 -
1.2 milk2 简单模拟
线段,区间。我用的是离散化,在模拟的方法。线段树应该更高效,有空细看一下线段树Three farmers rise at 5 am each morning and head for the barnto milk three cows. The first farmer begins milking his cow at time300 (measured in seconds after 5 am) and ends at time 1000. Thesecond farmer begins原创 2010-10-25 23:27:00 · 369 阅读 · 0 评论 -
1.2 namenum 递归枚举
<br />Name That Number<br /><br />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 ca原创 2010-10-28 20:18:00 · 465 阅读 · 0 评论 -
1.2 palsquare 转化为对应进制,再判断是否为回文
Palindromic Squares<br />Rob Kolstad<br /> Palindromes are numbers that read the same forwards as backwards.The number 12321 is a typical palindrome.<br /> Given a number base B (2 <= B <= 20 base 10), print all theintegers N (1 <= N <= 300 base原创 2010-10-29 15:04:00 · 378 阅读 · 0 评论 -
1.5 超级肋骨质数
Superprime Rib<br />Butchering Farmer John's cows always yields the best prime rib. Youcan tell prime ribs by looking at the digits lovingly stamped acrossthem, one by one, by FJ and the USDA. Farmer John ensures that apurchaser of his prime ribs g原创 2010-11-12 12:20:00 · 699 阅读 · 0 评论
分享