!-- 自定制样式文件 -->
摘要: √]是会的,[√*]是会大概/一半的 基础算法 贪心[√]、枚举[√]、分治[√]、二分、倍增、构造、高精[√]、模拟[√]* 图论 图 最短路(dijkstra、spfa、floyd),差分约束[√*] 最小生成树(kruskal、prim)] 并查集(扩展域)[√*] 拓扑排序 二分图染色,*二 阅读全文
posted @ 2020-08-05 08:17 XzhouxxX 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 题目如下 看似可以暴搜的一个题然而会有这么一个情况:x*y<=9的情况下暴搜没有一点问题,但是x*y>=10的情况下就要另外考虑了,(要进位啊)但是可以推出来一个很妙的方法(看了别人讲后才知道)看一下啊6*8=48 66*8=528 666*8=5328 6666*8=53328 66666*8=5 阅读全文
posted @ 2021-07-31 18:56 XzhouxxX 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 我的理解: 一个问题有多个阶段,每个阶段有多种状态,每个状态有多种策略,策略中最优的是决策 状态转移方程:把每个状态中找出最优的决策,写出状态转移方程基本能理解dp(多肝题) 最优化原理:说一个最优策略的子策略,也是最优的(看的资料) 无后效性:确定某个阶段状态后,这个阶段后的发展不受这个阶段以前各 阅读全文
posted @ 2021-01-24 22:11 XzhouxxX 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 一开始用的二分,想分开来算,结果啊就没做对,后来用的前缀和,也不知道对不对,提交不了了 一开始用个x把所有的和都加起来,还有就是判断时要x-a[i]-a[i],否则就不对了 代码: 阅读全文
posted @ 2021-01-24 17:46 XzhouxxX 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 要注意时单加,就是指一个牛奶多少钱 可以for一个一个的加,什么时候到需求量的时候就bz退出 上代码: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#include 阅读全文
posted @ 2020-09-21 21:47 XzhouxxX 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 找到了一个非常妙的代码 神奇代码 阅读全文
posted @ 2020-09-20 22:18 XzhouxxX 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 这个题很水(我做半天 用字符串函数find就可以 找不到返回-1;或 string::npos 上代码: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#includ 阅读全文
posted @ 2020-09-13 21:15 XzhouxxX 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目: 就是判断当前是不是地雷,如果是的话既让另一个二维数组为1,否则的话就是零,这应该是构造吧 然后再用一个二维for来输出,如果当前是地雷的话,就不管他,直接输出,否则的话就cout里面加上八个方向:v[i][j+1]+v[i][j-1]+v[i+1][j]....... 特别注意的话,要从开始 阅读全文
posted @ 2020-08-25 20:28 XzhouxxX 阅读(96) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#include <stack>#include <map>#include <set>#include <queue> 阅读全文
posted @ 2020-08-19 11:32 XzhouxxX 阅读(97) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#include <stack>#include <map>#include <set>#include <queue> 阅读全文
posted @ 2020-08-19 11:28 XzhouxxX 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#include <stack>#include <map>#include <set>#include <queue> 阅读全文
posted @ 2020-08-19 11:19 XzhouxxX 阅读(95) 评论(0) 推荐(0) 编辑