You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo...
分类:
其他好文 时间:
2015-07-16 15:57:57
阅读次数:
108
题目:After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. Thi...
分类:
其他好文 时间:
2015-07-15 12:49:39
阅读次数:
116
What does it mean for an algorithm to be fairIn 2014 the White House commissioned a 90-day study that culminated in areport(pdf) on the state of “big ...
分类:
其他好文 时间:
2015-07-14 20:14:30
阅读次数:
146
题目传送门 1 /* 2 题意:寻找一个根节点,求min f(u) = ∑ρ(v, u) * p(v)。ρ(v, u)是u到v的距离,p(v)是v点的权值 3 树形DP:先从1出发遍历第一次,sum[u]计算u到所有子节点v的路径权值(之后的点路径有叠加,所以先把路径权值加后*w),...
分类:
其他好文 时间:
2015-07-14 19:45:06
阅读次数:
99
House of Representatives
#include
#include
#include
using namespace std;
typedef long long ll;
#define N 1111111
ll dp[N];
int a[N];
ll sum[N],ans[N];
struct EDGE {
int v, next;
ll...
分类:
其他好文 时间:
2015-07-14 11:38:23
阅读次数:
117
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo...
分类:
其他好文 时间:
2015-07-13 20:16:27
阅读次数:
97
内容提要列表定义;合一在列表中的使用;匿名变量;列表定义正如名字暗示的,列表就是多个元素组成的集合。更精确地说,是元素的有限序列。在Prolog中的列表,有如下的一些具体例子:[mia, vincent, jules, yolanda][mia, robber(honey_bunny), X, 2,...
分类:
其他好文 时间:
2015-07-10 18:32:07
阅读次数:
155
原文 Jasper White is one of those rare people who believes in ancient myths. He has just bought a new house in the city, but ever since he moved in, he has had trouble with cars and their owners. W...
分类:
其他好文 时间:
2015-07-09 23:00:51
阅读次数:
377
构造函数绑定 //基类建筑物var building = function () { this.spec = "building";}; //address:房子地址,toward:房子朝向var house = function (address, toward) { this.address =...
分类:
Web程序 时间:
2015-07-09 12:37:48
阅读次数:
145
动态规划问题,定义个数组,将现阶段的所有走过的步数的最优解保存到数组中对应下标处。在进行下一步的时候,通过调用已知数组和当前节点的情况进行讨论,做出决策。 1 class Solution { 2 public: 3 int rob(vector& nums) { 4 int...
分类:
其他好文 时间:
2015-07-08 12:24:47
阅读次数:
130