USACO培训页面美国计算机奥林匹克训练页2015年6月17日开始
USACO培训页面美国计算机奥林匹克训练页2015年6月17日开始
参加了 USACODecember 2015 Contest。 从Bronze打起,Bronze/Silver/Gold 均满分。Platinum基本只会暴力,或不会做,共278/1000,最后几名了。 大海豚 Platinum 544 (前三级均满分),小海豚 Silver 667(Bronze满分...
样例解释:让 3 队与 9 队进行比赛,并让 9 队晋级。最后,第 6 队和第 10 队比赛, 10 队获胜。FJ注意到一个不寻常的事情:在任何游戏中,两个团队的总分是两个团队ID的按位异或(XOR)。例如,如果第 12 队和第 20...
USACO测试数据 data
这道题算是见过奶牛题里面最难的。。是我见识太少了 绕了一大圈,问了Q巨才明白这题怎么做 下面是Q巨原话 先考虑前i张牌,并且是大的赢 ...but……这样做的话可能会出现,一张牌被用了多次的情
Description Farmer John has installed a new system of N−1 pipes to transport milk between the N stalls in his barn (2≤N≤50,000), conveniently numbered 1…N. Each pipe connects a pair of stalls, ...
Description Bessie the cow is a huge fan of card games, which is quite surprising, given her lack of opposable thumbs. Unfortunately, none of the other cows in the herd are good opponents....
Description Ever the maturing businessman, Farmer John realizes that he must manage his time effectively. He has N jobs conveniently numbered 1..N (1 <= N <= 1,000) to accomplish (like m...
【USACO 2015 Open Gold】Palindromic Paths 动态规划 from 辗转山河弋流歌 题意: 从 n×n 的矩阵 左上角走到右下角会有一个长度 n+n+1 的字符串,问有多少种走法使得路径字符串为回文? 题解: f(i,j,k,l)...
【问题描述】 每年奶牛们举行一场奇特的活动。他们从左岸出发,一个个小心地跳过河上的石头,最后跳到右岸。左右岸上各有一块石头,分别是起点和终点,而它们之间有N块石头在河上,它们与两岸的两块石头处在同一条...
。。。
Usaco 的一道比较简单的,适合初学者的题目
→题目链接← 从编号为1的点跑spfa,然后把两个点到1的距离加一起就好了 大水题 #include #include #include #include using namespace std; struct node{ int to,len; int now; }; vectorv[50050];...int
题面 FJ把杂志上所有的文章摘抄了下来并把它变成了一个长度不超过10^5的字符串S。他有一个包含n个单词的列表,列表里的n个单词记为t_1…t_N。他希望从S中删除这些单词。 FJ每次在S中找到最早出现的列表中的单词(最早...
Description 给定一棵有N个点的树,所有节点的权值都为0。有K次操作,每次指定两个点s,t,将s到t路径上所有点的权值都加一。请输出K次操作完毕后权值最大的那个点的权值。 Input 第一行,两个整数N(2≤N≤50,000...
Description Farmer John went to cut some wood and left N (2 <= N <= 100,000) cows eating the grass, as usual. When he returned, he found to his horror that the cows were in his garden ea...
Usaco Geteven 农民约翰和贝西牛爱交换数学游戏在他们的空闲时间。最后一个谜团FJ给贝西是非常困难,她未能解决它。现在她想跟FJ,给他一个具有挑战性的难题。 贝西给了FJ表达式(B + E + S + S +I+ E)(G + O + E + ...
Description Bessie and Bonnie have found a treasure chest full of marvelous gold coins! Being cows, though, they can't just walk into a store and buy stuff, so instead they decide to have some...
文章目录题目描述输入格式输出格式数据范围输入样例输出样例思路分析 题目描述 厌倦了农场寒冷的冬季天气,奶牛贝茜计划飞往一个温暖的目的地度假。 不幸的是,她发现只有一家航空公司,博维尼亚航空,愿意向奶牛...
2015: [Usaco2010 Feb]Chocolate Giving Time Limit: 10 Sec Memory Limit: 162 MB Submit: 428 Solved: 273 [Submit][Status][Discuss] Description Farmer John有B头奶牛(1居住在农场P_i的奶牛A(1 ...
→题目链接← 每个牌肯定是管第一个比它小的牌是最优的 所以我们只需要从小到大记录对面目前还剩几张牌,手里只要有能管的就管上一个 代码: #include #include using namespace std;... i
USACO 2015 Feb:Censoring
BFS,建边比较麻烦
Description Farmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and observe the beautiful silhouettes formed by the rectangular buildings....
树链剖分模板题
本来打算帮YummyJay写几题,没想到直接就刷完了==Bessie Goes Moo简单的暴力题,所有数对7取模暴力即可。Trapped in the Haybales一开始看错了题目结果发现自己出了一道神贪心== 设草垛质量为m,位置为p ...
http://www.usaco.org/index.php?page=dec15results A: 题意:2* n张牌编号1-2*n,你和对手各n张,你已经知道了对手的牌和出牌顺序(也就是知道了自己的牌)。共n轮出牌,每轮没人出一张。前n/2(n是偶数)轮点数大...
bzoj 3940 Censoring 题目描述 FJ把杂志上所有的文章摘抄了下来并把它变成了一个长度不超过10^5的字符串S。 他有一个包含n个单词的列表,列表里的n个单词记为T1......Tn。他希望从S中删除这些单词。...
同3942,把KMP换成AC自动机。 开一个栈,记录一下每个位置匹配到哪个节点,如果是单词节点,那么弹出对应长度的字符串。 #include #include #include #include ...int ch[maxn][26],fail[maxn],q[ma
原题来自:USACO 2015 Feb. Gold 有一个长度不超过10510^5105的字符串SSS。Farmer John 希望在SSS中删掉nnn个屏蔽词(一个屏蔽词可能出现多次),这些词记为t1∼tnt_1\sim t_nt1∼tn。 FJ 在SSS中从头开始寻找...