摘要: Farmer John's cows like to keep in touch via email so they have created a network of cowputers so that they can intercowmunicate. These machines route 阅读全文
posted @ 2017-02-20 21:36 sigongzi 阅读(532) 评论(0) 推荐(0) 编辑
摘要: This problem requires you to write a program that performs character recognition. Each ideal character image has 20 lines of 20 digits. Each digit is 阅读全文
posted @ 2017-02-20 17:58 sigongzi 阅读(861) 评论(0) 推荐(0) 编辑
摘要: 1001: [BeiJing2006]狼抓兔子 Description 现在小朋友们最喜欢的"喜羊羊与灰太狼",话说灰太狼抓羊不到,但抓兔子还是比较在行的, 而且现在的兔子还比较笨,它们只有两个窝,现在你做为狼王,面对下面这样一个网格的地形: 左上角点为(1,1),右下角点为(N,M)(上图中N=4 阅读全文
posted @ 2017-02-18 21:00 sigongzi 阅读(218) 评论(0) 推荐(0) 编辑
摘要: You have won a contest sponsored by an airline. The prize is a ticket to travel around Canada, beginning in the most western point served by this airl 阅读全文
posted @ 2017-02-17 20:45 sigongzi 阅读(599) 评论(0) 推荐(0) 编辑
摘要: Farmer John wants to place a big square barn on his square farm. He hates to cut down trees on his farm and wants to find a location for his barn that 阅读全文
posted @ 2017-02-17 11:43 sigongzi 阅读(360) 评论(0) 推荐(0) 编辑
摘要: A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools t 阅读全文
posted @ 2017-02-15 13:39 sigongzi 阅读(496) 评论(0) 推荐(0) 编辑
摘要: You've just be assigned the project of implemented a windowing interface. This windowing interface is fairly simple, and fortunately, you don't have t 阅读全文
posted @ 2017-02-14 16:55 sigongzi 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 蚂蚁(ant.pas/c/cpp)题目大意在平面上有 N 只蚂蚁 N 个树洞,每个树洞只能容纳下一只蚂蚁,蚂蚁们都是直线行走的。 现在蚂蚁们希望能进入树洞中, 希望你能构造出一种方案使得任意两个蚂蚁的路线不相交。保证不会出现三点共线的情况。对于有多种不同的解,输出任意一组即可。无解时,输出-1。输入 阅读全文
posted @ 2017-02-13 22:43 sigongzi 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 斐波那契(fib.pas/c/cpp)题目大意众所周知,斐波那契数列就是 F(n)=F(n-1)+F(n-2),F(1)=F(2)=1,然后大小为 n 的一维斐波那契表就是 F(1),F(2),F(3),F(4)…F(n)。我们定义二维的斐波那契表的第(i,j)个位置也就是a(i,j)=F(i+j- 阅读全文
posted @ 2017-02-13 22:37 sigongzi 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 巧克力(chocolate.pas/c/cpp)题目大意现在有一块巧克力,大小为 n*m。现在要把它掰成 n*m 块 1*1 的小块。每次你可以选择一块巧克力,横着或者竖着把它掰成两块。求掰巧克力的最小次数。输入文件输入文件为 chocolate.in。输入第一行为 T,代表有 T 组数据。接下来 阅读全文
posted @ 2017-02-13 21:57 sigongzi 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 摩天大楼(dom.pas/c/cpp)题目大意在数轴上有 N 栋摩天大楼,第 i 栋的位置为 Xi,高度为 Hi,现在你需要推倒所有的摩天大楼。你每次可以选择炸毁一个大楼使得它往左边倒下去,或者往右边倒下去,在一栋摩天大楼倒下去的时候,有可能顺带推倒了一些其他的摩天大楼。第 i 栋大楼向左倒会将所有 阅读全文
posted @ 2017-02-13 21:55 sigongzi 阅读(350) 评论(0) 推荐(0) 编辑
摘要: ————————————————————题解 统计这一列或行放通道能隔开几个人,然后贪心 输出没有排序QWQ 阅读全文
posted @ 2017-02-13 20:58 sigongzi 阅读(175) 评论(0) 推荐(0) 编辑
摘要: ——————————————————————————题解 路径的长度是1-200000 然后路径的条数有n*(n+1)/2 根据鸽巢原理n*(n+1)/2 > 200000就一定是YES 所以复杂度只有n^2 阅读全文
posted @ 2017-02-13 20:55 sigongzi 阅读(163) 评论(0) 推荐(0) 编辑
摘要: ————————————————————————————————————————题解 唯一没有想出来的题 我们发现以上两种操作 a0,a3,a6,a9……的相对位置不变 a1,a4,a7,a10……的相对位置不变 a2,a5,a8,a12……的相对位置不变 所以只要记下a0,a1,a2最后的位置,就 阅读全文
posted @ 2017-02-13 20:50 sigongzi 阅读(163) 评论(0) 推荐(0) 编辑
摘要: ————————————————————————————————————————————题解 把最短路处理出来然后做背包 没有把head数组和all初始化qwq 阅读全文
posted @ 2017-02-13 20:39 sigongzi 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Farmer John must measure Q (1 <= Q <= 20,000) quarts of his finest milk and deliver it in one big bottle to a customer. He fills that bottle with exac 阅读全文
posted @ 2017-02-12 21:37 sigongzi 阅读(489) 评论(0) 推荐(0) 编辑
摘要: Sally Snail likes to stroll on a N x N square grid (1 <n <= 120). She always starts in the upper left corner of the grid. The grid has empty squares ( 阅读全文
posted @ 2017-02-09 18:55 sigongzi 阅读(383) 评论(0) 推荐(0) 编辑
摘要: Farmer John wishes to build a fence to contain his cows, but he's a bit short on cash right. Any fence he builds must contain all of the favorite graz 阅读全文
posted @ 2017-02-08 21:02 sigongzi 阅读(364) 评论(0) 推荐(0) 编辑
摘要: 相当于在背包上面挂vector,这样我们就可以求出容量为j所有k优解 转移是把dp[i-1][j][k] 和 dp[i-1][j-w[i]][k]向dp[i][j][k]上转移,因为这两个地方的k优解的2k个解里一定含有dp[i][j]的k优解,而且这两个序列有单调性 可以直接把所有数赋为-inf然 阅读全文
posted @ 2017-02-08 19:37 sigongzi 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 24 星球的末日【问题描述】24 星球的世界末日就要到了 , 可是诺亚方舟还没有制造完成 。 为了制造诺亚方舟这个星球上的所有国家都站在统一战线 。 现在一共有n个国家 , 一个国家到另一个国家都有一条且仅有一条通信渠道,且这个渠道有一个距离,这样就形成了一个有向完全图。 。 世界末日的预兆已经来了 阅读全文
posted @ 2017-02-07 18:58 sigongzi 阅读(260) 评论(0) 推荐(0) 编辑