题解:
首先考虑dfs,但是看到答案的“64bit”就放弃了吧、
所以肯定是组合数、状压DP什么的,尤其是那个16,标准的状压数。
好吧,就是状压DP。
f[i][j]表示i是状压的01串表示哪个取了哪个没取,然后j是结尾字符,
虽然水,但是时间复杂度是可以过的。
代码:
#include
#include
#include
#include
#include...
分类:
其他好文 时间:
2015-01-02 12:17:27
阅读次数:
148
最近在自己实验搭建openstack平台,开始准备使用kvm搭建实验环境,先记录下安装过程中遇到的一些小的问题。给 ubuntu 配置两张网卡时,遇到问题,使用ifup eth1 时候 :rtnetlink answers file exists fail to bring up eth1,问题原因...
分类:
系统相关 时间:
2015-01-02 10:59:34
阅读次数:
294
【题目】
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tre...
分类:
其他好文 时间:
2015-01-01 23:49:22
阅读次数:
189
Search in Rotated Sorted Array IIFollow up for "LeetCode: Search in Rotated Sorted Array 解题报告":What ifduplicatesare allowed?Would this affect the run-...
分类:
其他好文 时间:
2015-01-01 21:07:17
阅读次数:
240
http://poj.org/problem?id=2653我很好奇为什么这样$O(n^2)$的暴力能过....虽然说这是加了链表优化的,但是最坏不也是$O(n^2)$吗。。。(只能说数据太弱...)然后本题裸的判线段相交和点在直线上...(看了网上的标程,不判端点的情况都能过我也是醉了...)#i...
分类:
其他好文 时间:
2015-01-01 17:18:03
阅读次数:
130
- baseline (7w rps/core)- switch from large accelerator to regular accelerator (9w rps/core)- replace all materials with diffuse (12w rps/core)- remov...
分类:
其他好文 时间:
2015-01-01 13:38:37
阅读次数:
193
Two Sum II - Input array is sorted
Total Accepted: 441
Total Submissions: 1017
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a...
分类:
其他好文 时间:
2014-12-31 08:43:53
阅读次数:
164
12 Golden Rules For Living 12条生活黄金定律1. If you open it, close it.开了头的,记得结束。2. If you turn it on, turn it off.一旦打开,记得关上。3. If you unlock it, lock it up....
分类:
其他好文 时间:
2014-12-31 06:19:45
阅读次数:
152
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum
...
分类:
其他好文 时间:
2014-12-30 19:10:58
阅读次数:
135