设一棵树有两个子树A,B。Pa是房子在A子树上的概率,Pb是房子在B子树上的概率。 先走A子树寻找房子的期望是: 【在A子树上找到房子的路程】*Pa+(【没有在A子树上找到房子的路程(固定的一个值)】+【在B子树上找到房子的路程】)*Pb。 先走B子树寻找房子的期望是: 【在B子树上找到房子的路程】 ...
分类:
其他好文 时间:
2017-06-15 14:28:57
阅读次数:
192
传送门 tarjan缩点后是个DAG,然后只有一个出度为0的点的话就输出该点的大小,否则为0。 1 #include<cstdio> 2 #define repu(i,x,y) for(i=x;i<=y;i++) 3 #define min(a,b) (a<b?a:b) 4 #define N 50 ...
分类:
其他好文 时间:
2017-06-14 18:10:13
阅读次数:
119
1.获取指定主机指定组件的信息列表 2.获取主机列表 3.获取主机的各种状态 注意:最后一个参数还可以换成"host_state", 用来判断机器健康状态 : "HEALTHY/HEARTBEAT_LOST 4.获取服务状态 5.获取组件信息 6.获取指定主机上的服务 7.获取服务状态 8.获取集群 ...
基本安装yuminstallrsync配置文件位置/etc/rsyncd.confrsync同步备份软件分2种场景使用一.不同服务器之间备份1.使用服务端进程来同步修改配置文件如下uid=root
gid=root
usechroot=yes
maxconnections=4
pidfile=/var/run/rsyncd.pid
#exclude=lost+found/
#transferlogging=ye..
分类:
其他好文 时间:
2017-06-13 14:25:05
阅读次数:
193
Sightseeing Cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10306 Accepted: 3519 Description Farmer John has decided to reward his cow ...
分类:
其他好文 时间:
2017-06-12 00:47:07
阅读次数:
276
Description Farmer John has purchased a subscription to Good Hooveskeeping magazine for his cows, so they have plenty of material to read while waitin ...
分类:
其他好文 时间:
2017-06-12 00:43:42
阅读次数:
343
http://poj.org/problem?id=3186 Treats for the Cows 给定一个双端队列dq,其中有n个正整数元素。 每次可从dq头或者尾中取出1个元素。 第i次(从1开始计数)取出的元素能带来的权值为i*元素值。 问能取得的最大权值。 解题报告 思路 假设现在的状态为 ...
分类:
其他好文 时间:
2017-06-11 18:25:04
阅读次数:
200
原文地址:http://nkcoder.github.io/blog/20140712/mysql-reconnect-packet-lost/ 1.1 错误信息: 1.2 解决方法 - 如果使用的是JDBC,在JDBC URL上添加?autoReconnect=true,如: - 如果是在Spri ...
分类:
数据库 时间:
2017-06-11 12:03:47
阅读次数:
334
P2826 [USACO08NOV]光开关Light Switching 题目描述 Farmer John tries to keep the cows sharp by letting them play with intellectual toys. One of the larger toys ...
分类:
其他好文 时间:
2017-06-10 22:28:16
阅读次数:
317
Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 13381 Accepted: 5208 Description The cows, as you know, have no fingers or thumbs and thus ...
分类:
其他好文 时间:
2017-06-10 16:57:13
阅读次数:
213