摘要:
4.最终版在三基础上将vector优先队列替换为pair<int,pair<int,int>> class Solution { struct cmp { bool operator() (const pair<int, pair<int, int> >& a, const pair<int, pa 阅读全文
摘要:
1.转成int处理结果超出int最大值了 class Solution { public: int ret=-1; int findMinStep(string board, string hand) { int bnum=9;//补一位9 int hnum[6]={0}; //RYBGW //46 阅读全文
摘要:
坐标席判断线段是否相交 class Solution { public: bool isSelfCrossing(vector<int>& distance) { if(distance.size()<4){ return false; } vector<pair<int, int>> s = { 阅读全文
摘要:
1.重复计算太多pass class Solution { public: int numDecodings(string s) { return (int)_numDecodings(s,0); } long long _numDecodings(string s,int i) { if(i>=s 阅读全文
摘要:
1.出度为0则为满足条件的节点,取所有出度为0的到queue中,之后循环减去这些队列中的出度,正反索引减少访问时间 class Solution { public: vector<int> eventualSafeNodes(vector<vector<int>>& graph) { vector< 阅读全文
摘要:
C++三种容器:list、vector和deque的区别 https://blog.csdn.net/gogokongyin/article/details/51178378 https://blog.csdn.net/xiajun07061225/article/details/7442816 h 阅读全文
摘要:
内存池 https://www.mdeditor.tw/pl/g2Jw pool_allocator https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-api-4.6/a00979_source.html https://blog.csdn.net 阅读全文
摘要:
1.记录索引交换 class Solution { public: int minSwapsCouples(vector<int>& row) { int len=row.size(); vector<int> idx(len,-1); int ret=0; for(int i=0;i<len;++ 阅读全文
摘要:
Dijkstra算法 https://www.cnblogs.com/biyeymyhjob/archive/2012/07/31/2615833.html dijkstra Bellman_Ford与Floyd算法的性质比较与实现 https://blog.csdn.net/jxlincong/a 阅读全文
摘要:
Hierholzer算法https://taodaling.github.io/blog/2019/04/25/Hierholzer%E7%AE%97%E6%B3%95/https://www.cnblogs.com/vocaloid01/p/9514023.htmlhttps://www.jian 阅读全文