摘要: 题目大意:给一个n阶方阵,求A1+A2+A3+......Ak。题目分析:令F(k)=A1+A2+A3+......Ak。当k为偶数时,F(k)=F(k/2)*(E+Ak/2),k为奇数时,F(k)=F(k/2)*(E+Ak/2)+Ak。证明这两条公式也很简单,把这两条公式展开就行了。根据公式,递归... 阅读全文
posted @ 2015-08-18 17:48 20143605 阅读(574) 评论(0) 推荐(0) 编辑
摘要: 题目大意:给出a+b的值和ab的值,求a^n+b^n的值。题目分析:有种错误的方法是这样的:利用已知的两个方程联立,求解出a和b,进而求出答案。这种方法之所以错,是因为这种方法有局限性。联立之后会得到一个二元一次方程,只有当该方程有实数解确切的说是当某个数据满足该方程有实数解时,这种方法得到的结果才... 阅读全文
posted @ 2015-08-18 13:55 20143605 阅读(460) 评论(0) 推荐(0) 编辑
摘要: Description"Hike on a Graph" is a game that is played on a board on which an undirected graph is drawn. The graph is complete and has all loops, i.e. ... 阅读全文
posted @ 2015-08-17 17:11 20143605 阅读(275) 评论(0) 推荐(0) 编辑
摘要: DescriptionImagine you are standing inside a two-dimensional maze composed of square cells which may or may not be filled with rock. You can move nort... 阅读全文
posted @ 2015-08-17 14:57 20143605 阅读(612) 评论(1) 推荐(1) 编辑
摘要: Problem DescriptionIgnatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息:密码是一个C进制的数,并且只能由给定的M个数字构成,同时密码是一个给定十进制整数N(0 2 # include 3 #... 阅读全文
posted @ 2015-08-16 15:57 20143605 阅读(225) 评论(0) 推荐(0) 编辑
摘要: DescriptionYou are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot i ... 阅读全文
posted @ 2015-08-16 15:43 20143605 阅读(196) 评论(0) 推荐(0) 编辑
摘要: DescriptionA common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks... 阅读全文
posted @ 2015-08-16 15:40 20143605 阅读(144) 评论(0) 推荐(0) 编辑
摘要: DescriptionWhen a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a stron... 阅读全文
posted @ 2015-08-16 15:33 20143605 阅读(190) 评论(0) 推荐(0) 编辑
摘要: DescriptionThe cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies, chainsaw-... 阅读全文
posted @ 2015-08-16 15:23 20143605 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始Ignatius被关在(sx,sy)的位置,离开地牢的门在(e... 阅读全文
posted @ 2015-08-14 16:35 20143605 阅读(446) 评论(0) 推荐(0) 编辑