def Mean(t): """均值""" return float(sum(t)) / len(t)
分类:
其他好文 时间:
2014-07-15 00:09:49
阅读次数:
516
WPF产生不重复的随机数在给定的区间范围(比如[50,99]),产生给定数量的随机数(不如10个),要求产生的随机数不重复首先给定变量min=50;max=99+1;//习惯与程序规定的编码不同所致n=10;好了,上代码1.xaml界面格式 ...
分类:
其他好文 时间:
2014-07-14 22:27:23
阅读次数:
355
联通块是指给定n个点,输入a,b(1#includeusing namespace std;const int maxn=1010;int p[maxn];//作为每个独立的点 int sum[maxn];//每个节点下面连接的点 int find(int x) {if(x==p[x])return...
分类:
移动开发 时间:
2014-07-14 22:21:30
阅读次数:
403
timer
用法
#include
#include
using namespace std;
using namespace boost;
int main()
{
timer t;//声明一个计时器对象,开始计时
cout<<"max:"<<t.elapsed_max()/3600<<"h"<<endl; //可度量的最大时间,以小时为单位...
分类:
其他好文 时间:
2014-07-14 17:27:39
阅读次数:
162
当你循环输入的时候我们有几种方法
一:while(scanf("%d %d",&a,&b)!=EOF)//>0//==1
反正有很多种,但是今天早上我用两个代码提交发现了问题
相同的算法但是第一个超时
#include
#include
#define max 1000000+10
#include
using namespace std;
int a[max];
int cmp(int...
分类:
其他好文 时间:
2014-07-14 16:46:36
阅读次数:
201
我们可以通过在java程序中模拟浏览器一样,把数据抓下来,具体方法是在java程序中set header和cookie,下面是一个例子:
public class NetConnection {
public static final int MAX_HOTWORDS_FILE_SIZE = 256 * 1024;
public static void main(String[] args...
分类:
编程语言 时间:
2014-07-14 13:34:03
阅读次数:
219
最近再写一个网络仿真器,里面参考了Max-MinFairness算法,这是一种比较理想、公平的带宽分配算法。其思路主要如下:首先是算法的准备,考察某一时刻的网络中所有的flow,由于每条flow都有其各个link,因此可以得到各个link上所有流经的flow,然后开始迭代,各个link都把capacity平均分给所有流经的flow,接着每条flow的速度就等于其最小link分配的带宽,然后每条li...
分类:
其他好文 时间:
2014-07-14 13:14:33
阅读次数:
160
点击打开链接
题意:有n条村落连接线路,给你m个草儿附近的村落,在给出t个草儿想去的地方。从草儿附近的村落出发到她想去的地方所有线路中的花费时间最少的一个。
解析:多源多点最短路,暴力枚举
#include
#include
#include
using namespace std;
const int maxn = 1005;
const int Max = 0xfffffff;
i...
分类:
其他好文 时间:
2014-07-14 12:57:00
阅读次数:
214
1、进入information_schema数据库(存放了其他的数据库的信息)useinformation_schema;2、查询所有数据的大小:SELECTconcat(round(sum(DATA_LENGTH/1024/1024),2),’MB’)asdataFROMTABLES;3、查看指定数据库的大小:比如查看数据库hellodb的大小SELECTconcat(round(sum(DATA_..
分类:
数据库 时间:
2014-07-14 11:39:30
阅读次数:
253
Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sum...
分类:
其他好文 时间:
2014-07-14 10:42:22
阅读次数:
192