05 2016 档案

摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4607 题解:给定一棵树,从树中的任意选一个顶点出发,遍历K个点的最短距离是多少?(每条边的长度为1) 算法分析: 首先如果k小于等于直径长度,那么答案为k−1;如果k大于直径长度,设直径长度为r,那么答 阅读全文
posted @ 2016-05-29 21:34 Vmetrio 阅读(253) 评论(0) 推荐(0)
摘要:自己写挫了...借鉴的别人的代码... 题目链接:http://poj.org/problem?id=2631 题解链接:http://blog.csdn.net/v5zsq/article/details/50654640 Description 给出一棵无向树,求树的直径,即树上两点之间的最长距 阅读全文
posted @ 2016-05-29 16:59 Vmetrio 阅读(258) 评论(0) 推荐(0)
摘要:训练比赛的时候没有写出来... 搜了发题解... 链接:http://www.cppblog.com/willing/archive/2010/05/02/114167.aspx 代码: 阅读全文
posted @ 2016-05-29 15:44 Vmetrio 阅读(139) 评论(0) 推荐(0)
摘要:B君要用一个表面积为S的圆锥将白山云包起来。 B君希望包住的白山云体积尽量大,B君想知道体积最大可以是多少。 注意圆锥的表面积包括底面和侧面。 B君要用一个表面积为S的圆锥将白山云包起来。 B君希望包住的白山云体积尽量大,B君想知道体积最大可以是多少。 注意圆锥的表面积包括底面和侧面。 B君希望包住 阅读全文
posted @ 2016-05-28 19:51 Vmetrio 阅读(284) 评论(0) 推荐(0)
摘要:可以用二分写... 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 收藏 关注 给出长度为 阅读全文
posted @ 2016-05-27 17:11 Vmetrio 阅读(561) 评论(0) 推荐(0)
摘要:题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 收藏 关注 题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 题目来源: CodeForces 基准时间限制:1  阅读全文
posted @ 2016-05-27 16:28 Vmetrio 阅读(270) 评论(0) 推荐(0)
摘要:转载于熊猫: http://blog.csdn.net/qq_32734731/article/details/51484729 阅读全文
posted @ 2016-05-26 20:50 Vmetrio 阅读(172) 评论(0) 推荐(0)
摘要:线段树 线段树是一种二叉搜索树,与区间树相似,它将一个区间划分成一些单元区间,每个单元区间对应线段树中的一个叶结点。 对于线段树中的每一个非叶子节点[a,b],它的左儿子表示的区间为[a,(a+b)/2],右儿子表示的区间为[(a+b)/2+1,b]。因此线段树是平衡二叉树,最后的子节点数目为N,即 阅读全文
posted @ 2016-05-26 20:19 Vmetrio 阅读(535) 评论(0) 推荐(0)
摘要:A. 异形卵 Time Limit: 1000ms Memory Limit: 128000KB 64-bit integer IO format: Java class name: Time Limit: 1000ms Memory Limit: 128000KB Submit Status PI 阅读全文
posted @ 2016-05-25 11:04 Vmetrio 阅读(278) 评论(0) 推荐(0)
摘要:题目描述 传说HMH大沙漠中有一个M*N迷宫,里面藏有许多宝物。某天,Dr.Kong找到了迷宫的地图,他发现迷宫内处处有宝物,最珍贵的宝物就藏在右下角,迷宫的进出口在左上角。当然,迷宫中的通路不是平坦的,到处都是陷阱。Dr.Kong决定让他的机器人卡多去探险。 但机器人卡多从左上角走到右下角时,只会 阅读全文
posted @ 2016-05-24 17:32 Vmetrio 阅读(581) 评论(0) 推荐(0)
摘要:网上发现了不错的博客讲解... 熊猫的板子:http://blog.csdn.net/qq_32734731/article/details/51484729 组合数的预处理(费马小定理|杨辉三角|卢卡斯定理):http://www.indestinee.com/combinationinit/ 求 阅读全文
posted @ 2016-05-23 20:33 Vmetrio 阅读(431) 评论(0) 推荐(0)
摘要:最近打的几场比赛,都出现了有关逆元的题目,今天就整理了一下... 求乘法逆元的几种方法:http://www.cnblogs.com/james47/p/3871782.html 博文转载链接:http://blog.csdn.net/acdreamers/article/details/82207 阅读全文
posted @ 2016-05-23 20:21 Vmetrio 阅读(167) 评论(0) 推荐(0)
摘要:All X Accepts: 1281 Submissions: 7580 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) All X Accepts: 1281 Submissions 阅读全文
posted @ 2016-05-22 19:29 Vmetrio 阅读(1230) 评论(2) 推荐(0)
摘要:Description Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, 阅读全文
posted @ 2016-05-21 19:09 Vmetrio 阅读(373) 评论(0) 推荐(0)
摘要:Time Limit: 1000ms Memory Limit: 128000KB 64-bit integer IO format: Java class name: Time Limit: 1000ms Memory Limit: 128000KB Submit Status Submit St 阅读全文
posted @ 2016-05-19 20:54 Vmetrio 阅读(254) 评论(0) 推荐(0)
摘要:Time Limit: 1000ms Memory Limit: 128000KB 64-bit integer IO format: Java class name: Time Limit: 1000ms Memory Limit: 128000KB Submit Status Submit St 阅读全文
posted @ 2016-05-19 20:52 Vmetrio 阅读(231) 评论(0) 推荐(0)
摘要:Time Limit: 1000ms Memory Limit: 128000KB 64-bit integer IO format: Java class name: Time Limit: 1000ms Memory Limit: 128000KB Submit Status Submit St 阅读全文
posted @ 2016-05-19 20:51 Vmetrio 阅读(243) 评论(0) 推荐(0)
摘要:题目描述 南将军统率着N个士兵,士兵分别编号为1~N,南将军经常爱拿某一段编号内杀敌数最高的人与杀敌数最低的人进行比较,计算出两个人的杀敌数差值,用这种方法一方面能鼓舞杀敌数高的人,另一方面也算是批评杀敌数低的人,起到了很好的效果。 所以,南将军经常问军师小工第i号士兵到第j号士兵中,杀敌数最高的人 阅读全文
posted @ 2016-05-16 23:03 Vmetrio 阅读(229) 评论(0) 推荐(0)
摘要:Problem A Accepts: 1829 Submissions: 12436 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem A Accepts: 1829 Su 阅读全文
posted @ 2016-05-16 10:54 Vmetrio 阅读(369) 评论(0) 推荐(0)
摘要:Problem Description Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: Take 阅读全文
posted @ 2016-05-13 20:17 Vmetrio 阅读(170) 评论(0) 推荐(0)
摘要:Problem Description 人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世界科学家思考的问题,同样的问题Eddy也一直在思考,因为他在很小的时候就知道亲和串如何判断了,但是发现,现在长大了却不知道怎么去判断亲和串了,于是他只好又再一次来请教聪明且乐于助人的你来解决这个问题。亲 阅读全文
posted @ 2016-05-12 21:00 Vmetrio 阅读(150) 评论(0) 推荐(0)
摘要:Problem Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Ouli 阅读全文
posted @ 2016-05-12 20:42 Vmetrio 阅读(166) 评论(0) 推荐(0)
摘要:学习链接: http://blog.csdn.net/v_july_v/article/details/7041827 代码: 阅读全文
posted @ 2016-05-12 20:26 Vmetrio 阅读(140) 评论(0) 推荐(0)
摘要:Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Yo 阅读全文
posted @ 2016-05-12 20:22 Vmetrio 阅读(142) 评论(0) 推荐(0)
摘要:学习链接: http://www.cppblog.com/mythit/archive/2009/04/21/80633.html http://blog.csdn.net/niushuai666/article/details/7002736 http://www.cnblogs.com/kuan 阅读全文
posted @ 2016-05-12 09:45 Vmetrio 阅读(159) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2016-05-11 17:18 Vmetrio 阅读(2) 评论(0) 推荐(0)
摘要:Time Limit: 1000ms Memory Limit: 128000KB 64-bit integer IO format: Java class name: Time Limit: 1000ms Memory Limit: 128000KB Submit Status PID: 5213 阅读全文
posted @ 2016-05-11 16:41 Vmetrio 阅读(188) 评论(0) 推荐(0)
摘要:Time Limit: 1000ms Memory Limit: 128000KB 64-bit integer IO format: Java class name: Time Limit: 1000ms Memory Limit: 128000KB Submit Status Submit St 阅读全文
posted @ 2016-05-10 21:10 Vmetrio 阅读(256) 评论(0) 推荐(0)
摘要:Problem Description 给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等 Input 输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c...y,z组成的字符串S两组ca 阅读全文
posted @ 2016-05-10 17:36 Vmetrio 阅读(157) 评论(0) 推荐(0)
摘要:1081 子段求和 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 1081 子段求和 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 1081 子段求和 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基 阅读全文
posted @ 2016-05-06 20:56 Vmetrio 阅读(356) 评论(0) 推荐(0)