题目大意:
怎么分配n个任务到m个服务器上使得负载尽量平衡。
思路:
将任务从大到小排序,依次放入负载最小的那个服务器中。
因为是spj 的缘故,所以可以使用这个贪心。
比如数据
6 2
7 5 3 3 3 3
就会得到错误答案。
#include
#include
#include
#include
#include
using nam...
分类:
其他好文 时间:
2014-07-22 23:03:34
阅读次数:
300
Qt调用DLL方法
直接调用DLL则需要三个文件,头文件(.h)、导入库文件(.lib)、动态链接库(.dll),具体步骤如下:
注意:在qtCreaor中生成的动态库库文件文件为.a结尾,vs生成的动态链接库是.lib结尾
1、首先我们把 .h与.lib/.a 文件复制到程序当前目录下,然后再把dll文件复制到程序的输出目录(如果是debug版的话就将mydlld.dll放在此文件夹...
分类:
其他好文 时间:
2014-05-01 21:54:21
阅读次数:
438
The server network address “TCP://myserverAddress:50221″ cannot be reached or does not exist.
Check the network address name and that the ports for the local and remote endpoints are operational.
(Microsoft SQL Server, Error: 1418)...
分类:
Web程序 时间:
2014-05-01 18:35:53
阅读次数:
665
Linux下读写UART串口的代码,从IBM Developer network上拿来的东西,操作比较的复杂,就直接跳过了,好在代码能用,记录一下~
两个有用的函数~
////////////////////////////////////////////////////////////////////////////////
/**
*@brief 设置串口通信速率
*@param fd...
分类:
系统相关 时间:
2014-05-01 18:04:52
阅读次数:
629
runtime
bundle/vim-pathogen/autoload/pathogen.vimset nocompatible " be iMproved,
requiredfiletype off " required" set th...
分类:
其他好文 时间:
2014-05-01 08:38:20
阅读次数:
327
这段时间公司实行代理上网,不仅通过浏览器上网需要不停的输入用户名和密码,在本地调试程序时候Eclipse竟然也弹出框让输入用户名和密码。
如图:
解决办法:
windows--preferences--general---Network Connections.它默认界面如图所示:
将界面改为如下界面,重启Eclipse即可:...
分类:
系统相关 时间:
2014-04-30 22:13:39
阅读次数:
447
linux虚拟机网络问题
刚安装一个vmware虚拟机,并在上面安装了一个redhat linux操作系统。
安装完后配制了下网络。
首先观察windows上的网络配制。
ip:192.168.1.109
nemask:255.255.255.0
gateway:192.168.1.1
通过这些东西可以看出虚拟机也应该在同一个网段(192.168.1.0),同一个网关(192.168...
分类:
系统相关 时间:
2014-04-29 13:32:23
阅读次数:
552
VBA bat create excel files
the datasource is current excel...
分类:
其他好文 时间:
2014-04-29 13:24:22
阅读次数:
259
提到计算机,就得提计算机的起源,就得提到计算机的工作原理,就得提到计算机的内存装载,早期计算机没有这么“透明化”,不像windows和安卓ios这么无脑,各种内存操作都是直接进行,不可能少了这些概念。无论download也好,upload也罢,都在强调一个load~!内存也好,硬盘也罢,都要装进去才算数,什么叫做”拷贝“下来到本机?本机是哪里?你不从计算机知识解读说明,恕我无法认同~!
个人觉得这东西确实应该读四声,为什么三声人多呢,可能平时载发三声的时候就比较多,所以忽略了四声的发音和用法了。
窃以为...
分类:
其他好文 时间:
2014-04-29 13:24:21
阅读次数:
427
Problem Description
In the Wide Web World, Which web server was popular in web site? Apache, nginx, lighttpd? Baidu.com use Apache, and many web sites like 163.com use nginx. Why? Its configuration i...
分类:
其他好文 时间:
2014-04-29 13:24:20
阅读次数:
355