物资调度
某地区发生了地震,灾区已经非常困难,灾民急需一些帐篷、衣物、食品和血浆等物资。可通往灾区的道路到处都是塌方,70%以上的路面损坏,桥梁全部被毁。国家立即启动应急预案,展开史上最大强度非作战空运行动,准备向灾区空投急需物资。
一方有难,八方支援。现在已知有N个地方分别有A1,A2,….,An个物资可供调配。目前灾区需要物资数量为M。
现在,请你帮忙算一算,总共有多少种物质调度...
分类:
其他好文 时间:
2015-05-04 10:12:29
阅读次数:
111
星际之门(一)
时间限制:3000 ms | 内存限制:65535 KB
难度:3
描述
公元3000年,子虚帝国统领着N个星系,原先它们是靠近光束飞船来进行旅行的,近来,X博士发明了星际之门,它利用虫洞技术,一条虫洞可以连通任意的两个星系,使人们不必再待待便可立刻到达目的地。
帝国皇帝认为这种发明很给力,决定用星际之门把自己统治的各个星系连结在一起。
...
分类:
其他好文 时间:
2015-05-04 10:12:40
阅读次数:
117
机房重构之存储过程,注册功能。...
分类:
其他好文 时间:
2015-05-04 10:10:58
阅读次数:
125
#include
#include
#include
#include
#include
#define M 2
using namespace std;
struct BTNode{
int keyNum;
int key[2*M-1]; //关键字数组
struct BTNode* child[2*M];//孩子结点数组
bool isLeaf;
};
void D...
分类:
其他好文 时间:
2015-05-04 10:12:01
阅读次数:
109
1601: War
Time Limit: 1 Sec Memory Limit:
128 MB
Submit: 85 Solved: 25
[Submit][Status][Web
Board]
Description
AME decided to destroy CH’s country. In CH’ country, There are N villages, w...
分类:
其他好文 时间:
2015-05-04 10:09:28
阅读次数:
136
题意:给你一个m*n(1
船不能放在冰山上;
船不能放到浮冰上
两艘船之间除非中间有冰山,否则不能在同一列或同一行。
分析:红果果的二分最大匹配。。。。图也很容易构造。。。把每一行被冰山分隔开来的海洋格子连通块(至少一个格子)作为X点,同样的每一列被冰山分隔开来的海洋格子连通块作为Y点,X点与Y点有边相连当且仅当这两个连通块共用一个海洋格子。然后跑二分最大匹配。。。2500个点...
分类:
其他好文 时间:
2015-05-04 10:11:04
阅读次数:
134
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.Th...
分类:
其他好文 时间:
2015-05-04 10:12:08
阅读次数:
100
Area
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 5248
Accepted: 2352
Description
Being well known for its highly innovative products, Merck would defin...
分类:
其他好文 时间:
2015-05-04 10:10:46
阅读次数:
120
The Semantics of Data
0引例
1 The Binding of a Data Member
2Data Member Layout
3Data Member 的存取
4继承与Data Member
5Object Member Efficiency
6Pointer to Members
时隔很久,再次拾起<>一书.期间因为学习<<C++ Prim...
分类:
其他好文 时间:
2015-05-04 10:11:25
阅读次数:
136
题意:给定一个串和k,求这个串字典序第k的序列。...
分类:
其他好文 时间:
2015-05-04 10:10:11
阅读次数:
105
//base.js
var $=function(_this)//调用,把this传递过来
{
return new Base(_this);
};
//对象式
function Base(_this)
{
//创建一个数组来获取节点和节点的数组
this.elements=[];//私有化,不共用
if(_this!=u...
分类:
其他好文 时间:
2015-05-04 10:10:00
阅读次数:
110
//Base.js
var $=function(_this)//调用,把this传递过来
{
return new Base(_this);
};
//对象式
function Base(_this)
{
//创建一个数组来获取节点和节点的数组
this.elements=[];//私有化,不共用
if(_this!=undef...
分类:
其他好文 时间:
2015-05-04 10:09:00
阅读次数:
130
题目的意思是,两行城市,从左到右为1,2,3……n个城市。上面的下面的城市要与上面某个的城市相连,在不出现相交的情况下,最多可以连多少条。
知道了题意,就知道了应该用DP来做。
这一题,数据量比较大,用普通的DP,时间复杂度为N^2,会超时,我们应该用另一种DP方法,时间复杂度为nlogn。
nlogn的DP的思路大概就是给你一个数,插到一个数组中,该位置已存在,就覆盖它。也就是可以用二分查...
分类:
其他好文 时间:
2015-05-04 10:08:50
阅读次数:
173
A - Combination Lock
题意:
给两个密码,为最小多少次能吻合。
思路:
对于每一位设a
#include
using namespace std;
int main()
{
int n;
char x[1234],y[1234];
while(cin>>n)
{
scanf("%s%s",x,y);
int ans...
分类:
其他好文 时间:
2015-05-04 10:07:11
阅读次数:
129
Prime Ring Problem
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 31900 Accepted Submission(s): 14108
Problem Description
A ring is...
分类:
其他好文 时间:
2015-05-04 10:06:07
阅读次数:
163
题目传送:Zipper
思路:设状态DP[i][j]为字符串A前i个字符和B前j个字符能否组成C的前i+j个字符,能则为true,否则false
AC代码:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include...
分类:
其他好文 时间:
2015-05-04 10:08:00
阅读次数:
155
Ultra-QuickSort
Time Limit: 7000MS
Memory Limit: 65536K
Total Submissions: 46293
Accepted: 16846
Description
In
this problem, you have to analyze ...
分类:
其他好文 时间:
2015-05-04 10:07:46
阅读次数:
133