银行有n个窗口,每个窗口可以排m个人,在n×m以外的顾客会选择最短的队列进行排队。给出每个顾客需要消耗的时间长度,求出每个顾客具体结束服务的时间。
//本题需要有较好的抽象能力,把题目的问题,转化了相应的数学模型,这样就容易办了...
分类:
其他好文 时间:
2015-02-26 10:00:54
阅读次数:
124
注意到数据规模比较小(N#include #include using namespace std;int n;bool compare(vector a, vector b) { for (int i = 0; i != n; ++i) { if (a[i] != b[i]) ...
分类:
其他好文 时间:
2014-12-01 12:45:51
阅读次数:
188
依题意构造树并遍历,找出最大深度并统计#include #include using namespace std;struct Node { vector children; int depth;};Node nodes[100005];int maxDepth = 0;int tota...
分类:
其他好文 时间:
2014-12-01 12:40:15
阅读次数:
212
如果直接使用递归,会因为递归层数过多导致段错误因此使用queue代替递归//递归调用层数过多,使用queue代替#include #include #include using namespace std;struct Point { int z, x, y; Point(int z, ...
分类:
其他好文 时间:
2014-12-01 12:36:17
阅读次数:
219
1080. Graduate Admission (30) (模拟排序啊 ZJU_PAT)...
分类:
编程语言 时间:
2014-11-29 11:54:46
阅读次数:
259
1002. A+B for Polynomials (25) (数学啊 ZJU_PAT)...
分类:
其他好文 时间:
2014-11-28 20:11:58
阅读次数:
204
1001. A+B Format (20) (数学啊 ZJU_PAT)...
分类:
其他好文 时间:
2014-11-27 22:07:43
阅读次数:
161
1017. A除以B (20) (数学啊 ZJU_PAT)...
分类:
其他好文 时间:
2014-11-24 20:58:58
阅读次数:
177
1018. 锤子剪刀布 (20) (数学啊 ZJU_PAT)...
分类:
移动开发 时间:
2014-11-24 20:58:01
阅读次数:
180