摘要: 题目描述 Bessie has two crisp red apples to deliver to two of her friends in the herd. Of course, she travels the C (1 <= C <= 200,000) cowpaths which are 阅读全文
posted @ 2017-11-09 17:55 Hammer_cwz_77 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 12 using namespace std; 13 const int INF=1q; 38 ... 阅读全文
posted @ 2017-11-09 07:48 Hammer_cwz_77 阅读(761) 评论(0) 推荐(1) 编辑
摘要: 题目描述 所谓虫食算,就是原先的算式中有一部分被虫子啃掉了,需要我们根据剩下的数字来判定被啃掉的字母。来看一个简单的例子: 43#9865#045 +8468#6633 44445509678 其中#号代表被虫子啃掉的数字。根据算式,我们很容易判断:第一行的两个数字分别是5和3,第二行的数字是5。 阅读全文
posted @ 2017-08-24 11:45 Hammer_cwz_77 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 题目背景 矩阵快速幂 题目描述 给定n*n的矩阵A,求A^k 输入输出格式 输入格式: 第一行,n,k 第2至n+1行,每行n个数,第i+1行第j个数表示矩阵第i行第j列的元素 输出格式: 输出A^k 共n行,每行n个数,第i行第j个数表示矩阵第i行第j列的元素,每个元素模10^9+7 输入输出样例 阅读全文
posted @ 2017-08-23 20:13 Hammer_cwz_77 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Consider an N x N (1 <= N <= 100) square field composed of 1 by 1 tiles. Some of these tiles are impassible by cows and are marked with an 'x' in 阅读全文
posted @ 2017-08-18 19:36 Hammer_cwz_77 阅读(1611) 评论(0) 推荐(1) 编辑
摘要: 题目描述 Copy从卢牛那里听说在一片叫yz的神的领域埋藏着不少宝藏,于是Copy来到了这个被划分为个区域的神地。卢牛告诉了Copy这里共有个宝藏,分别放在第Pi个(1<=Pi<=N)区域。Copy还得知了每个区域之间的距离。现在Copy从1号区域出发,要获得所有的宝藏并到n号区域离开。Copy很懒 阅读全文
posted @ 2017-08-17 21:55 Hammer_cwz_77 阅读(343) 评论(0) 推荐(1) 编辑
摘要: 题目描述 如题,现在有一个并查集,你需要完成合并和查询操作。 输入输出格式 输入格式: 第一行包含两个整数N、M,表示共有N个元素和M个操作。 接下来M行,每行包含三个整数Zi、Xi、Yi 当Zi=1时,将Xi与Yi所在的集合合并 当Zi=2时,输出Xi与Yi是否在同一集合内,是的话输出Y;否则话输 阅读全文
posted @ 2017-08-14 20:34 Hammer_cwz_77 阅读(284) 评论(0) 推荐(2) 编辑
摘要: 题目描述 Like everyone else, FJ is always thinking up ways to increase his revenue. To this end, he has set up a series of tolls that the cows will pay wh 阅读全文
posted @ 2017-08-14 15:52 Hammer_cwz_77 阅读(459) 评论(1) 推荐(2) 编辑
摘要: 题目描述 Farmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practicing jumping over hurdles. They are ge 阅读全文
posted @ 2017-08-14 11:41 Hammer_cwz_77 阅读(245) 评论(0) 推荐(1) 编辑
摘要: 题目背景 [Usaco2008 Jan] 题目描述 N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code 阅读全文
posted @ 2017-08-14 09:35 Hammer_cwz_77 阅读(203) 评论(0) 推荐(1) 编辑