摘要: 基本思想: 提前打表,直接算; 关键点: 无; #include<iostream> #include<vector> #include<algorithm> #include<string> #include<cmath> #include<set> #include<map> using nam 阅读全文
posted @ 2020-02-29 22:15 暮云林凌 阅读(221) 评论(0) 推荐(0)
摘要: 基本思想: 无; 关键点: 无; #include<iostream> #include<vector> #include<algorithm> #include<string> #include<cmath> #include<set> using namespace std; int main( 阅读全文
posted @ 2020-02-29 21:50 暮云林凌 阅读(137) 评论(0) 推荐(0)
摘要: 基本思想: 想到贪心,但是觉得时间复杂度太高,结果一不小心写出来个更复杂的贪心; 关键点: 注意特殊用例,有可能无法遍历出正确结果,即没有切换得到正确的值,此时要避免进入死循环; #include<iostream> #include<vector> #include<algorithm> #inc 阅读全文
posted @ 2020-02-29 21:47 暮云林凌 阅读(153) 评论(0) 推荐(0)
摘要: https://www.nowcoder.com/practice/04c8a5ea209d41798d23b59f053fa4d6?tpId=40&tqId=21334&tPage=1&rp=1&ru=/ta/kaoyan&qru=/ta/kaoyan/question-ranking 基本思想: 阅读全文
posted @ 2020-02-29 20:49 暮云林凌 阅读(176) 评论(0) 推荐(0)
摘要: https://www.nowcoder.com/practice/0383714a1bb749499050d2e0610418b1?tpId=40&tqId=21333&tPage=1&rp=1&ru=/ta/kaoyan&qru=/ta/kaoyan/question-ranking 基本思想: 阅读全文
posted @ 2020-02-29 20:31 暮云林凌 阅读(353) 评论(0) 推荐(0)
摘要: 基本思想: 附带路径代价的最短路径生成; 关键点: 无; #include<iostream> #include<fstream> #include<sstream> #include<vector> #include<string> #include<cstring> #include<algor 阅读全文
posted @ 2020-02-29 16:58 暮云林凌 阅读(183) 评论(0) 推荐(0)
摘要: 基本思路: 主要有两点: 1.多路径保存问题,主要是vector<int>,来保存每个节点的多个前驱节点; 2.对于逆序前驱数组,采用DFS,枚举每个分支,采用逆序访问进行根节点遍历; 关键点: 上述两个问题; #include<iostream> #include<fstream> #includ 阅读全文
posted @ 2020-02-29 16:21 暮云林凌 阅读(152) 评论(0) 推荐(0)
摘要: 基本思想: 主题思想是迪杰斯特拉算法,但是在其基础上做了相关的改进; 1.要求统计等长路径条数; 2.在等长路径的基础上,需要再次选择节点权值最大的哪个; 关键点: 路径保存pre,利用前驱节点保存; 等长路径统计用num[]; 权值统计用weight[]; 比较套路化的流程; 但是注意一点,等长路 阅读全文
posted @ 2020-02-29 14:39 暮云林凌 阅读(281) 评论(0) 推荐(0)