![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
USACO
文章平均质量分 84
newlaide
这个作者很懒,什么都没留下…
展开
-
【USACO】PROB Broken Necklace
Broken Necklace You have a necklace of N red, white, or blue beads (3 1 2 1 2 r b b r b r r b r原创 2012-06-12 14:40:56 · 546 阅读 · 0 评论 -
[USACO]Runaround Numbers
Runaround Numbers Runaround numbers are integers with unique digits, none of which is zero (e.g., 81362) that also have an interesting property, exemplified by this demonstration: If you start a原创 2012-09-26 14:48:30 · 526 阅读 · 0 评论 -
[USACO]Subset Sums
Subset Sums JRM For many sets of consecutive integers from 1 through N (1 For example, if N=3, one can partition the set {1, 2, 3} in one way so that the sums of both subsets are identical: {3}原创 2012-09-19 21:40:05 · 535 阅读 · 0 评论 -
[USACO]clocks
提交了15次,一直超时。后来参考别人的解题思路,和自己的做了对比,复杂度一致,差在一个常数倍上。 采用BFS算法,和别人的想法有些不太一样。 用一个树来代表全部有效的操作步骤,从根到每个叶的路径为一个有效的操作,每个节点的value为一个二维数组,数组的第一个元素代表该节点子节点值的取值下限,如若为4,则第一个子树的值应当为4,第二个为5,一次类推;第二个元素代表从根节点到本节点第一个元素值出原创 2012-08-21 14:07:48 · 772 阅读 · 0 评论 -
[USACO]checker
八皇后问题,要求输出按数值排序的前三种布局方式(用一个数组代表每行皇后放置位置),以及布局的种类。 写了两个方案,第一个为循环,第二个为递归。循环复杂度超了一点,没有通过。递归做了优化,可以通过。 两个方案都贴出来,做些对比: 方案一:循环,用一个数组保存前几行皇后摆放情况以及未放置皇后的列信息。第二种方法也是用同样的数组进行信息保存,这样做不知道算不算是个偷巧,因为这样并不能保证得到全部的原创 2012-08-21 14:33:05 · 383 阅读 · 0 评论 -
[USACO]Healthy Holsteins
Healthy Holsteins Burch & Kolstad 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 vita原创 2012-08-29 09:21:00 · 693 阅读 · 0 评论 -
[USACO]Prime Cryptarithm
Prime Cryptarithm 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 pr原创 2012-07-25 10:45:29 · 489 阅读 · 0 评论 -
[USACO]Arithmetic Progressions
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.原创 2012-08-08 08:56:02 · 975 阅读 · 0 评论 -
[USACO]Calf Flac -- 时间复杂度还是略高
Calf Flac It 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-18 10:45:48 · 523 阅读 · 0 评论 -
[USACO]Barn Repair
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 ful原创 2012-07-16 22:44:40 · 396 阅读 · 0 评论 -
[USACO]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 <= B <= 20 base 10), print all the原创 2012-07-16 22:40:51 · 536 阅读 · 0 评论 -
[USACO]Name That Number
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 th原创 2012-07-02 15:36:52 · 521 阅读 · 0 评论 -
[USACO]Transformations
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原创 2012-06-29 17:57:53 · 814 阅读 · 1 评论 -
[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原创 2012-06-28 22:52:31 · 529 阅读 · 0 评论 -
【USACO】PROB Friday the Thirteenth
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, wr原创 2012-06-12 23:58:43 · 554 阅读 · 0 评论 -
[USACO]Party Lamps
Party Lamps IOI 98 To brighten up the gala dinner of the IOI'98 we have a set of N (10 N. The lamps are connected to four buttons: Button 1: When this button is pressed, all the lamps change t原创 2012-10-17 16:01:54 · 582 阅读 · 0 评论