摘要: People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, wher 阅读全文
posted @ 2021-01-27 23:37 XA科研 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 第一种,先处理源点的邻接结点,再循环处理其他结点(同陈越姥姥慕课代码) int findMin(){//查找为收录结点中dist最小的点 int mind=inf; int minv=-1; for(int i=1;i<=N;i++){ if(collected[i]==false&&dist[i] 阅读全文
posted @ 2021-01-27 23:07 XA科研 阅读(108) 评论(0) 推荐(0) 编辑
摘要: map为映射,可以将任何基本类型(包括STL容器)映射到任何基本类型(包括STL容器) 一、map定义: map<typename1,typename2> mp; 二、访问: map中的键是唯一的 通过下标访问: 例如:mp['c']=20 迭代器访问: map<typename1,typename 阅读全文
posted @ 2021-01-27 14:31 XA科研 阅读(156) 评论(0) 推荐(0) 编辑
摘要: int型变量的取值范围:[-2^31, 2^31 - 1] -> [-2147483648, 2147483647] 0x7fffffff = 2147483647 = (2^31 - 1) = (1 << 31) - 1 0x3fffffff = 1073741823 = (2^30 - 1) = 阅读全文
posted @ 2021-01-27 14:21 XA科研 阅读(10521) 评论(0) 推荐(0) 编辑
摘要: set为集合,是一个内部自动有序且不含重复元素的容器 一、set的定义 set<typename> name; 二、元素访问 set只能通过迭代器(iterator)进行访问 set<typename> ::iterator it; 三、常用函数 (1)insert() insert(x)将x插入s 阅读全文
posted @ 2021-01-27 14:07 XA科研 阅读(137) 评论(0) 推荐(0) 编辑