![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
USACO
文章平均质量分 74
dont_say_sorry
这个作者很懒,什么都没留下…
展开
-
USACO Section 1.2 Complete Search
现在开始找机会慢慢刷USACO, 第一个专题 complete search, 差不多就是暴力乱搞 ~很多题都没有1A,这再次证明了我还太弱,以后还得多加努力啊 !1. Milking Cows做法: sort一遍, 合并重叠部分, 很水~#include using namespace std;struct node { int s, t; voi原创 2015-09-15 01:14:10 · 259 阅读 · 0 评论 -
USACO Section 2.2 Subset Sums
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} and {1,2}This counts as原创 2015-11-17 00:24:24 · 229 阅读 · 0 评论 -
USACO Section 2.2 Preface Numbering
Preface Numbering A certain book’s prefaces are numbered in upper case Roman numerals.Traditional Roman numeral values use a single letter to represent a certainsubset of decimal numbers. Here is th原创 2015-11-17 00:10:35 · 252 阅读 · 0 评论 -
USACO Section 2.3 Longest Prefix
The structure of some biological objects is represented by the sequence of their constituents, where each part is denoted by an uppercase letter. Biologists are interested in decomposing a long sequen原创 2015-11-17 00:40:20 · 248 阅读 · 0 评论 -
USACO Section 2.2 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 at the left digit (8 i原创 2015-11-17 00:35:41 · 236 阅读 · 0 评论 -
USACO Section 2.1
好久没补坑了, 擦...The Castle城堡里有一些房间, 问房间数,最大的房间, 拆掉一面墙后最大的房间, 拆哪个墙。简单的地图处理和dfs#include using namespace std;int w[55][55][4];int c[55][55];int v[10000];int dx[] = {0, -1, 0, 1}, dy[] = {-1, 0原创 2015-10-15 08:37:51 · 318 阅读 · 0 评论 -
USACO Section 1.4 More Search Technique
Orz, 感觉题已经慢慢开始变难了, 快要刷不动过了... 不知道我还能坚持刷多久。Arithmetic Progressions题意:一个可以表示为两个完全平方数相加的数被称为 bisquares (双平方数?), 给定底数的上限, 求这些底数两两构成的 bisquares 的集合中能构成项数为 n 的等差数列有哪些,要求输出首项和项数。由于是搜索专题, 就以为是搜索题(其原创 2015-09-16 20:27:59 · 222 阅读 · 0 评论 -
USACO Section 1.5
第一章最后一部分了,后面的大概要开始变得更难了。Nunber Triangles经典的 dp 题, 可以用记忆化搜索也可以用递推, 我用的是记忆化搜索。#include using namespace std;const int N = 1005;int f[N][N], n, a[N][N];int get(int r, int c) { if (r ==原创 2015-09-17 12:13:41 · 247 阅读 · 0 评论 -
USACO Section 1.3 Problems rest
Section 1.3 中除了分类的贪心,还有另外几道题, 不过并没有把这几道题贴上tags。我感觉这几道题更像简单的暴力和搜索,大概是复习之前所学知识吧。Prime Cryptarithm题目给出了一个三位数×两位数的竖式: * * * x * * ------- * * * <-- partial produ原创 2015-09-15 23:43:43 · 306 阅读 · 0 评论 -
USACO Section 1.3 Greedy Algorithm
两道贪心题, 刷水题完全没有成就感, 更不用说刷水题还一直wa了 OrzMixing Milk按照农夫提供的牛奶价格 sort一遍农夫, 贪心#include using namespace std;struct Farmer { int p, w; void read() { scanf("%d %d", &p, &w); }原创 2015-09-15 15:57:07 · 330 阅读 · 0 评论 -
USACO Section 2.2 Party Lamps
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 their state: those tha原创 2015-11-17 00:37:46 · 254 阅读 · 0 评论