上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 45 下一页
摘要: 1堆石子有n个,两人轮流取.先取者第1次可以取任意多个,但不能全部取完.以后每次取的石子数不能超过上次取子数的2倍。取完者胜.先取者负输出"Second win".先取者胜输出"First win". Input输入有多组.每组第1行是2<=n<2^31. n=0退出. Output先取者负输出"S 阅读全文
posted @ 2018-02-28 19:39 楼主好菜啊 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Now Fox Ciel becomes a commander of Tree Land. Tree Land, like its name said, has n cities connected by n - 1 undirected roads, and for any two cities 阅读全文
posted @ 2018-02-28 09:27 楼主好菜啊 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and v. Give an i 阅读全文
posted @ 2018-02-27 22:54 楼主好菜啊 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away wh 阅读全文
posted @ 2018-02-27 15:54 楼主好菜啊 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 推荐博客:https://www.cnblogs.com/patrickzhou/p/5867208.html Consider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the t 阅读全文
posted @ 2018-02-26 23:03 楼主好菜啊 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 推荐博客 : http://blog.csdn.net/ZHangFFYY/article/details/77871897 我们对一个图的存储基本有两种,邻近矩阵和邻接表 ,在补充一个链式前向星 用此方法存图 , 首先先定义一个结构体数组 struct node { int to, w; // t 阅读全文
posted @ 2018-02-26 11:06 楼主好菜啊 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 关于树上的分治,分为对 树上点的分治 和 边的分治 首先我们先来了解一下树的重心的定义 : 将树的重心删去以后,会被分出很多的子树,结点最多的树的个数最少,这个点称为树的重心 推荐博客 : https://www.cnblogs.com/Paul-Guderian/p/6782671.html 推荐 阅读全文
posted @ 2018-02-25 20:21 楼主好菜啊 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Jamie has recently found undirected weighted graphs with the following properties very interesting: The graph is connected and contains exactly n vert 阅读全文
posted @ 2018-02-25 09:36 楼主好菜啊 阅读(215) 评论(0) 推荐(0) 编辑
摘要: B. Jamie and Binary Sequence (changed after round) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output stand 阅读全文
posted @ 2018-02-24 23:12 楼主好菜啊 阅读(256) 评论(0) 推荐(0) 编辑
摘要: The swimming area of Berhattan's city beach is marked out with n buoys. The buoys form a straight line. When the buoys were being put into the water, 阅读全文
posted @ 2018-02-22 16:22 楼主好菜啊 阅读(198) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 45 下一页