摘要: 参考:https://www.bilibili.com/video/BV1Ax411U7Xx?spm_id_from=333.999.0.0 参考:https://baike.baidu.com/item/%E9%80%86%E5%BA%8F%E5%AF%B9/11035554?fr=aladdin 阅读全文
posted @ 2020-03-10 11:46 叫我妖道 阅读(377) 评论(0) 推荐(0) 编辑
摘要: https://www.bilibili.com/video/av32546525 代码与思路来自此 题目是:求 n 最少能表示成几个平方数的和 由于有 1*1=1 这个数,所以问题一定有解,因为 1 可以组成所有正整数 其中视频用到了宽搜,我是一点也没想到这种方法。 ① 把 0 作为起始点,0+一 阅读全文
posted @ 2020-03-08 12:39 叫我妖道 阅读(436) 评论(0) 推荐(0) 编辑
摘要: BFS: 优点:1,不会爆栈 2, 可以查询最小方案数 和 最短路径 缺点:空间是指数级别的 队列模板: q.push(head) while(!q.empty()) { vertex=q.front(); q.pop(); if(vertex 为目标状态) 输出 for( next=vertex+ 阅读全文
posted @ 2020-03-08 01:29 叫我妖道 阅读(221) 评论(2) 推荐(0) 编辑
摘要: 参考:https://www.bilibili.com/video/av25763384/?spm_id_from=333.788.videocard.0 一,BFS 与最短路径 1,BFS 生成树 通过 BFS 搜索顺序得到的生成树叫 BFS 生成树。 因为 BFS 是一层一层的向外扩展的,所以该 阅读全文
posted @ 2020-03-07 01:09 叫我妖道 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 参考: https://www.bilibili.com/video/av25763384/?spm_id_from=333.788.videocard.0 https://blog.csdn.net/qq_34823530/article/details/99202899 一,代码 #define 阅读全文
posted @ 2020-03-06 23:26 叫我妖道 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 参考: https://baike.baidu.com/item/Map/5808503?fr=aladdin https://bbs.csdn.net/topics/270020481( map<string,int>和map<char *,int>有什么区别?) https://www.cnbl 阅读全文
posted @ 2020-03-06 18:59 叫我妖道 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 基本摘抄自百度百科 其中,7 的 清空向量转载自 https://blog.csdn.net/a272846945/article/details/51182144 1,使用条件 头文件 <vector> 和 using namespace std; (因为他是属于 C++ 的) 2, 定义:简单地 阅读全文
posted @ 2020-03-06 18:12 叫我妖道 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 参考: https://www.bilibili.com/video/BV1Eb41147dK?from=search&seid=7630499509795698118 https://baike.baidu.com/item/%E5%A0%86%E6%8E%92%E5%BA%8F/2840151? 阅读全文
posted @ 2020-03-04 17:14 叫我妖道 阅读(697) 评论(2) 推荐(1) 编辑
摘要: 一,栈 1,stack 的常用函数 stack<int>s 定义一个存放 int 类型的 栈 s.push() 入栈一个元素 s.pop() 出栈一个元素 s.top() 取栈顶一个元素 s.size() 查看元素个数 s.empty() 若栈为空 返回 true, 否则 返回 false 清空栈代 阅读全文
posted @ 2020-02-29 11:34 叫我妖道 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.bilibili.com/video/BV17s41197Yy?spm_id_from=333.999.0.0 一,partition 函数 1,算法名称 我不知道这种算法叫什么,但我愿称之为 —— 区间移动 2,算法功能 解释 ① 从过程看:将某一区间的数,以区间最右 阅读全文
posted @ 2020-02-27 20:43 叫我妖道 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 参考: https://www.bilibili.com/video/BV1Px411z7Yo?from=search&seid=7644406790653491226 https://baike.baidu.com/item/kmp%E7%AE%97%E6%B3%95/10951804?fromt 阅读全文
posted @ 2020-02-25 20:48 叫我妖道 阅读(630) 评论(0) 推荐(0) 编辑
摘要: 参考: 一, https://www.cnblogs.com/qunqun/p/8653806.html int long long unsigned long long 数据范围 https://blog.csdn.net/lyl0625/article/details/7350045 在C语言中 阅读全文
posted @ 2020-02-24 15:03 叫我妖道 阅读(416) 评论(0) 推荐(0) 编辑
摘要: 此为别的文章看到的 https://www.jianshu.com/p/ca4d745e7d57 题目: 给一个非负整数,判断这个数是不是相互不同的非负整数的阶乘的和。如6 = 3!;7 = 3! + 1!;但5 不是相互不同的非负整数的阶乘的和。 int main(void) { int num; 阅读全文
posted @ 2020-02-23 11:26 叫我妖道 阅读(496) 评论(0) 推荐(0) 编辑
摘要: 参考: https://www.cnblogs.com/chenleideblog/p/10455723.html https://blog.csdn.net/qq_25800311/article/details/81607168 https://blog.csdn.net/lxt_Lucia/a 阅读全文
posted @ 2020-02-22 12:11 叫我妖道 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 参考: https://www.cnblogs.com/xyl-share-happy/archive/2012/08/28/2660873.html https://blog.csdn.net/jeffasd/article/details/80705487 1,scanf("%d", &n) ① 阅读全文
posted @ 2020-02-21 20:48 叫我妖道 阅读(1351) 评论(0) 推荐(0) 编辑
~~加载中~~