题目链接题意:给一颗树,用最少的点覆盖整棵树。分析:1:以当前节点为根节点,在该节点排士兵守护道路的最小消耗。在这种情况下,他的子节点可以安排士兵,也可以不安排士兵。可以从各个子节点两个不同状态(存在士兵,不存在士兵)的最值中选出最小的消耗,然后相加就求出了当前节点派士兵的最小消耗。2:以当前节点为...
分类:
其他好文 时间:
2014-09-05 22:15:52
阅读次数:
338
Description
After 4 years' waiting, the game "Chinese Paladin 5" finally comes out. Tomato is a crazy fan, and luckily he got the first release. Now he is at home, ready to begin his journey. But b...
分类:
其他好文 时间:
2014-09-05 18:21:51
阅读次数:
299
OverviewWe can get SegFault by several reasons:aligned access to unaligned memory(usally see in ARM NEON)cross-border accessint temp[2] = {0};temp[2] ...
分类:
系统相关 时间:
2014-09-05 17:57:01
阅读次数:
296
//UISegmentedControl是iOS中的分段控件,其实就是多个button的组合视图,通过切换不同的segment(点击不同的button),响应不同操作//NSArray*titles=@[@"轻拍",@"长按",@"轻扫",@"平移"];//UISegmentedControl*segmentControl=[[UISegmentedControlalloc]initWithItems:titles];//..
分类:
其他好文 时间:
2014-09-05 03:22:51
阅读次数:
200
题目链接Yet another game from chef. Chef gives youNcards andMbags. Each of theNcards has an integer written on it. Now chef asks you to close your eyes an...
分类:
其他好文 时间:
2014-09-04 22:15:00
阅读次数:
291
UVA 1045 - The Great Wall Game
题目链接
题意:给定一个n*n的棋盘,有n个棋子在上面,现在要移动棋子,每一步代价是1,现在要把棋子移动到一行,一列,或者在主副对角线上,问最小代价
思路:二分图完美匹配,枚举每种情况,建边,边权为曼哈顿距离,然后km算法做完美匹配算出值即可,由于要求最小值所以边权传负数,这样做出来的值的负就是答案
代码:
...
分类:
其他好文 时间:
2014-09-04 20:57:30
阅读次数:
340
ORACLE 11G中有个新特性,当表无数据时,不分配segment,以节省空间 解决方法: 1、insert一行,再rollback就产生segment了。 该方法是在在空表中插入数据,再删除,则产生segment。导出时则可导出空表。 2、设置deferred_segment_creat...
分类:
数据库 时间:
2014-09-04 18:20:19
阅读次数:
278
空白最多的最大子矩阵:
#include
#include
#include
using namespace std;
const int maxn = 1005;
int mat[maxn][maxn],up[maxn][maxn],left[maxn][maxn],right[maxn][maxn];
int main()
{
int t;
scanf("%d",&t);
...
分类:
其他好文 时间:
2014-09-04 17:02:59
阅读次数:
209
有时候像这种题,没有明显的思路,感觉像规律题。那么先暴力打表,再找规律就很快了。
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3798
先上我的暴力打表,这种肯定是TLE的,只用它发现规律就好了。
#include
#include
#include
#define INF 0x3f3f3f3f
#def...
分类:
其他好文 时间:
2014-09-03 22:48:57
阅读次数:
287
select?*?from?(select?row_number()over(order?by?Server_no?desc)?as?rownum,Server_no,Game_Name,Server_name?from?T_GameServer_List?where?IS_DELETE?=?‘N‘?and?Game_name?like?‘%q%‘)a...
分类:
数据库 时间:
2014-09-03 21:23:27
阅读次数:
215