题目链接:hdu_5788_Level Up 题意: 有一棵树,n个节点,每个节点有个能力值A[i],mid[i],mid的值为第i节点的子树的中位数(包括本身),现在让你将其中的一个节点的A值改为1e5,问所有的mid的和最大问多少。 题解: 我们可以知道,如果改变其中一个的A[i],如果A[i] ...
分类:
编程语言 时间:
2016-10-06 00:24:53
阅读次数:
268
题目大意:月亮从0到15,15下面是0、循环往复。给出n个数字,如果下一个数字大于第n个数字输出UP,小于输出DOWN,无法确定输出-1. 题目思路:给出0则一定是UP,给出15一定是DOWN,给出其他的一个数字(n==1)无法确定,其他的情况比较后两位。 1 #include<iostream> ...
分类:
其他好文 时间:
2016-10-05 15:26:55
阅读次数:
95
题目描述: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would h ...
分类:
其他好文 时间:
2016-10-05 13:11:08
阅读次数:
200
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex ...
分类:
其他好文 时间:
2016-10-05 12:40:00
阅读次数:
113
1.在本机启动单机版k8s /home/opama/workspace/k8s/src/k8s.io/kubernetes# hack/local-up-cluster.sh Go version: go version go1.6.2 linux/amd64 +++ [1004 21:39:33] ...
分类:
其他好文 时间:
2016-10-05 00:49:37
阅读次数:
246
http://poj.org/problem?id=1112 (题目链接) 题意 将n个人分成两组,每个人有认识的人,要求每一组中的人互相认识,并且两组人数之差尽可能的小,求如何分。 Solution 二分图染色的裸题,比较麻烦的是dp统计答案。。下午急着去打球,照着hzwer的程序码了一遍。 代码 ...
分类:
其他好文 时间:
2016-10-04 21:01:22
阅读次数:
194
题目链接 http://acm.hdu.edu.cn/search.php?action=listproblem Problem Description Ladies and gentlemen, please sit up straight.Don't tilt your head. I'm se ...
分类:
其他好文 时间:
2016-10-04 13:59:20
阅读次数:
156
Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? ...
分类:
其他好文 时间:
2016-10-03 17:03:00
阅读次数:
83
题目描述 Bessie the cow, always a fan of shiny objects, has taken up a hobby of mining diamonds in her spare time! She has collected diamonds () of varyin ...
分类:
其他好文 时间:
2016-10-03 06:50:36
阅读次数:
128
Love all, trust a few, do wrong to none. 爱所有人,信任一些人,不妨害任何人。 Reading is a way for me to expand my mind, open my eyes, and fill up my heart. 对我来说,阅读是拓宽思 ...
分类:
其他好文 时间:
2016-10-02 00:47:01
阅读次数:
150