码迷,mamicode.com
首页 > 其他好文
【经典dp】 poj 3671
开一个dp[30010][3]的数组其中dp[i][j]表示把第i个数改成j最少要花多少次那么状态转移方程就列出来了:令a=1 j!=a[i]0 j==a[i]那么dp[i][1]=dp[i-1][1]+a;dp[i][2]=min(dp[i-1][1],dp[i-1][2])+a;那么根据空间优化...
分类:其他好文   时间:2014-10-10 12:25:34    阅读次数:122
logstash启动报错 Exception in thread ">output" org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]
部署ELK时候,logstash启动报错Sending logstash logs to /var/log/logstash.log.Exception in thread ">output" org.elasticsearch.discovery.MasterNotDiscoveredExcept...
分类:其他好文   时间:2014-10-10 11:35:24    阅读次数:397
白话经典算法系列之七 堆与堆排序
堆排序与高速排序,归并排序一样都是时间复杂度为O(N*logN)的几种常见排序方法。学习堆排序前,先解说下什么是数据结构中的二叉堆。二叉堆的定义二叉堆是全然二叉树或者是近似全然二叉树。二叉堆满足二个特性:1.父结点的键值总是大于或等于(小于或等于)不论什么一个子节点的键值。2.每一个结点的左子树和右...
分类:其他好文   时间:2014-10-10 12:41:54    阅读次数:168
【最长下降子序列的长度和个数】 poj 1952
转自http://blog.csdn.net/zhang360896270/article/details/6701589这题要求最长下降子序列的长度和个数,我们可以增加数组maxlen[size](记录当前第1个点到第i个点之间的最长下降序列长度)和maxnum[size](记录1~i之间的最长下...
分类:其他好文   时间:2014-10-10 12:24:54    阅读次数:208
ASSERT函数
assert宏的原型定义在中,其作用是假设它的条件返回错误,则终止程序运行,原型定义:#include void assert( int expression );assert的作用是现计算表达式 expression ,假设其值为假(即为0),那么它先向stderr打印一条出错信息,然后通过调用 ...
分类:其他好文   时间:2014-10-10 11:50:34    阅读次数:201
实现 Math.Asin 迈克劳林(泰勒)展开式,结果比Math.Asin 慢一倍
项目中需要快速求解Asin(x) 的近似值,原以为用泰勒展开式会快一些,结果比原生的慢一倍。 Math.ASin Time Elapsed: 9ms Gen 0: 0 Gen 1: 0 ...
分类:其他好文   时间:2014-10-10 11:17:04    阅读次数:267
【最短路】 poj 2387
#include #include #include #include using namespace std;int map[1010][1010];int dis[1010];int n,pos,sum;void init(){ for(int i=0; i> t >> n; pos = n; ...
分类:其他好文   时间:2014-10-10 11:50:04    阅读次数:158
【bfs】 poj 3984 maze 队列存储
#include #include #include #define Max 0x7f7f7f7f using namespace std; int map[6][6]; int visited[6][6]; int dir[4][2]={{1,0},{-1,0},{0,-1},{0,1}};...
分类:其他好文   时间:2014-10-10 12:06:14    阅读次数:170
yum cannot retrieve metalink for repository
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again兄弟Ruiy哥的解决方案是从OS一样的系统scp /e tc/yum.repo.d/下的所有repo到本机的这个地方就O...
分类:其他好文   时间:2014-10-10 13:12:44    阅读次数:173
JMeter学习(十二)目录介绍
简单对JMeter的目录进行一些介绍
分类:其他好文   时间:2014-10-10 11:48:14    阅读次数:193
【二分图】 poj 1466
#include #include #include using namespace std;int c;const int maxn=502;int visit[maxn],map[maxn][maxn],link[maxn];bool DFS(int a){ for(int i=0;i> ...
分类:其他好文   时间:2014-10-10 11:48:04    阅读次数:132
开新缸养水全攻略
近来很多朋友都在发帖问,我开缸应该注意什么,开缸的步骤是什么,怎么能养好一缸水。诸位高手也在百问不烦孜孜不倦的解答,我总结了一下自己的一些经验一、器材的前期准备一个鱼缸首先要有器材,器材都包括以下几件,咱们以淡水缸为本体进行总结。1、过滤系统,可以是上滤,底缸过滤,侧滤,背滤,这些介绍论坛里无数了,...
分类:其他好文   时间:2014-10-10 12:20:54    阅读次数:177
测试一下
分类:其他好文   时间:2014-10-10 11:13:54    阅读次数:130
【两段连续不重合子序列和最大】 动态规划
最大子序列TimeLimit:1 SecondMemoryLimit:32 MegabyteTotalsubmit:156Accepted:42Description给定一个N个整数组成的序列,整数有正有负,找出两段不重叠的连续子序列,使得它们中整数的和最大。两段子序列都可以为空。Input多组输入...
分类:其他好文   时间:2014-10-10 12:53:44    阅读次数:177
HQL的检索方式
HQL是面向持久化类的,所以需要查询表的字段都要用持久化类指定例如String hql = "SELECT e.email, e.salary, e.dept FROM Employee e WHERE e.dept = :dept"; Query query = session.cr...
分类:其他好文   时间:2014-10-10 12:03:34    阅读次数:228
OpenStack Block Storage安装配置use LVM
1,storage systems use LVM Ins and configuration Block Storage;apt-get install lvm2;创建Physical volume创建volume groupadd a filter entry to the devices se...
分类:其他好文   时间:2014-10-10 12:36:24    阅读次数:274
【中国剩余定理】 poj 1006
生理周期简单模拟对于超出23 * 28 * 33(21252)时进行求余运算即可。#includeint main(){ //freopen("in.txt","r",stdin); int a,b,c,d,s,m=1; while(scanf("%d %d %d %d",&a,&...
分类:其他好文   时间:2014-10-10 12:02:54    阅读次数:254
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!