摘要: #include <iostream>#include <algorithm>using namespace std;struct time // this struct is used to store the information of meeting{ int id; int startTi 阅读全文
posted @ 2017-09-21 19:23 diamondDemand 阅读(549) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <string>using namespace std; void deleteDigite(int k, string str){ int len = str.length(); for(int i=0; i<k; i++) //there 阅读全文
posted @ 2017-09-21 16:16 diamondDemand 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 始终认为写代码应该写一段检查一段,检查各种逻辑问题及语法错误,凭感觉一波写下去,最后改的头大,既有逻辑错误,又有语法错误,很无奈,很难受,很伤心,很绝望,很想哭 阅读全文
posted @ 2017-09-19 15:39 diamondDemand 阅读(184) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <string.h>#include <stdlib.h>using namespace std;/********************************************************** * in this pro 阅读全文
posted @ 2017-09-14 20:27 diamondDemand 阅读(99) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <string.h>#include <stdlib.h>using namespace std;#define MaxNode 20struct HtNode{ double weight; int parent, leftChildren, 阅读全文
posted @ 2017-09-14 16:20 diamondDemand 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.liuchuo.net/archives/1967 分析:最终目标将列车按照从大到小的顺序输出,即按照输入顺序从大到小建立序列,至少需要几条序列,即需要几条铁轨 每一次插入都需要自动排序,且需要拿到必查入值大的且差距最小的那个值,所以使用set,s.rbegin()拿到 阅读全文
posted @ 2017-08-31 10:28 diamondDemand 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 连通子图的个数来判断有多少无法连通的区域,当失去一座城市的时候,如果连通子图的个数增加大于1,则整个国家的连通性被改变,增加数为0(单独的一个城市,本身不和其他任何城市相连)或1(边缘城市,和子图之间只有一条通路)说明没有改变连通性 阅读全文
posted @ 2017-08-30 17:06 diamondDemand 阅读(298) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include using namespace std; typedef struct HeapStruct *MinHeap; typedef int ElementType; struct HeapStruct { ElementType *ele; int size; ... 阅读全文
posted @ 2017-08-29 20:28 diamondDemand 阅读(149) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; vector in, pre; struct Node { int data; struct Node* left, *right; Node() { left = NULL; right = NULL; ... 阅读全文
posted @ 2017-08-28 17:05 diamondDemand 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 简单的结构体排序而已,不多说了 阅读全文
posted @ 2017-08-23 15:37 diamondDemand 阅读(140) 评论(0) 推荐(0) 编辑