摘要: 1.在17:00:00前(包括17整)来的客户,都要确保一直执行完,即使超过了17点。譬如一个在8点来的客户,处理时间需要20小时,也需要同样服务完,然后处理队列中的客户。2.只是对17:00:00后来的客户拒绝服务。3.逻辑顺序有问题,需要先插入,然后再减时间。4.首次插入,需要判断时间是否合适。... 阅读全文
posted @ 2015-11-04 22:04 siukwan 阅读(143) 评论(0) 推荐(0)
摘要: 1.需要熟悉进制转换的方法2.进制转换的第一步,通过求余求出string,此时的string恰好是倒序的正确的进制转换:while (num != 0) {//求余,把它转化为d进制格式的数,但求出来的string刚好是反的 char c = num%d + '0'; s += c; ... 阅读全文
posted @ 2015-11-04 12:59 siukwan 阅读(111) 评论(0) 推荐(0)
摘要: 1.判断记录好坏,把所有记录以string存起来,按照字典序排序,相邻的两条记录满足要求:第一条为on-line且第二条为off-line,才是成功匹配;2.采用计算00:00:00到现在的耗费和分钟数,这个方法比较简单3.最重要的:题目中只强调至少有一条匹配成功的记录,不是说每个人都至少有一条匹配... 阅读全文
posted @ 2015-11-04 12:47 siukwan 阅读(132) 评论(0) 推荐(0)
摘要: 1.银行排队时间模拟,采用合适的结构进行编程2.超过17:00(包括17:00)不再接受新用户,已经在处理的用户可以一直处理到17:59//#include//#include #include#include //#include#include#include#include//#include... 阅读全文
posted @ 2015-11-04 12:44 siukwan 阅读(128) 评论(0) 推荐(0)
摘要: 1.采用邻接矩阵才不会超内存,一开始采用edge的结构体存储,结果出现段错误(内存爆满)2.采用并查集的方法,统计时,遇到破坏的城市则不处理,否则进行合并3.最终检查并查集的集合数,集合数-2就是结果(集合数m减去破坏的城市,即m-1,令n=m-1,剩下的集合数n,需要采用n-1条边才能连接起来)/... 阅读全文
posted @ 2015-11-04 12:41 siukwan 阅读(145) 评论(0) 推荐(0)
摘要: 1.首先是平均分A,再到C,M,E2.通过重写不同的cmp函数,使用algorithm.h里面的sort进行排序3.如果分数相同,则排名相同,例如90,80,80,80,70,则排名为1,2,2,2,5//#include//#include #include#include //#include#... 阅读全文
posted @ 2015-11-04 12:38 siukwan 阅读(145) 评论(0) 推荐(0)
摘要: 1.较为简单2.最后的公式为(a*b*c*0.65-1)*2//#include//#include #include#include //#include#include#include#include//#include//#include//#include //#include "func.... 阅读全文
posted @ 2015-11-04 12:36 siukwan 阅读(156) 评论(0) 推荐(0)
摘要: 1.此题较为重点2.最小的radix为各位的数字最大值+13.采用二分法查找,l=radix,r=已知的数+14.要求的最大radix不一定是36//#include//#include #include#include //#include#include#include#include//#in... 阅读全文
posted @ 2015-11-04 12:33 siukwan 阅读(135) 评论(0) 推荐(0)
摘要: 1.直接创建最大的数组2.遍历所有的组合情况//#include//#include #include#include //#include#include#include#include//#include//#include//#include //#include "func.h"//#inc... 阅读全文
posted @ 2015-11-04 12:31 siukwan 阅读(152) 评论(0) 推荐(0)
摘要: 1.注意判断全为负数的情况,第一个数是否为负数,不要漏判断2.实际上采用动态规划,dp[i]=max{dp[i-1]+num[i],num[i]},dp[i]一定会包含当前的数字num[i],但是可以简化为判断dp[i-1]是否为负数//#include//#include #include#inc... 阅读全文
posted @ 2015-11-04 12:29 siukwan 阅读(125) 评论(0) 推荐(0)
摘要: 1.采用algorithm.h里面的sort函数,对时间进行排序,需要重写比较函数//#include//#include #include#include //#include#include#include#include//#include//#include//#include //#inc... 阅读全文
posted @ 2015-11-04 12:27 siukwan 阅读(241) 评论(0) 推荐(0)
摘要: 1.主要是string的位操作,string的每一位都是一个char//#include//#include #include#include //#include#include#include#include//#include//#include//#include //#include "f... 阅读全文
posted @ 2015-11-04 12:25 siukwan 阅读(130) 评论(0) 推荐(0)
摘要: 1.可为多叉树,采用vector保存子树名称2.采用map记录树节点3.采用广度遍历,输出每层的叶子节点数量节点代码如下:struct node{ vector child; int head; string ID; node() :head(-1), child(0), ID(""){};};源代... 阅读全文
posted @ 2015-11-04 12:21 siukwan 阅读(120) 评论(0) 推荐(0)
摘要: 1.采用dijkstra算法,算出最小耗费cost2.利用最小耗费cost最为约束条件,进行遍历搜索(循环->锁->dfs->解锁)//#include//#include #include#include //#include#include#include#include//#include//... 阅读全文
posted @ 2015-11-04 12:15 siukwan 阅读(117) 评论(0) 推荐(0)