04 2022 档案

摘要:电子学会六级-数据结构-离散化 离散化 离散化是一种数组处理编程技巧 有些数据因为本身很大或者类型不支持,自身无法作为数组的下标来方便地处理,而影响最终结果的只有元素之间的相对大小关系时,我们可以将原来的数据按照从大到小编号来处理问题,即离散化 用来离散化的可以是大整数、浮点数、字符串 离散化目的是 阅读全文
posted @ 2022-04-30 14:13 new-code 阅读(45) 评论(0) 推荐(0) 编辑
摘要:并查集 https://www.luogu.com.cn/problem/P3367 //https://blog.csdn.net/qq_43345339/article/details/105151512 #include<bits/stdc++.h> using namespace std; 阅读全文
posted @ 2022-04-28 16:31 new-code 阅读(16) 评论(0) 推荐(0) 编辑
摘要:破损的键盘 https://www.luogu.com.cn/problem/UVA11988 #include<bits/stdc++.h> const int N = 100000+5; int last, cur, next[N]; char s[N]; int main(){ while(s 阅读全文
posted @ 2022-04-25 22:00 new-code 阅读(15) 评论(0) 推荐(0) 编辑
摘要:KMP字符串匹配 https://www.luogu.com.cn/problem/P3375 #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 50; int nextval[N]; string s, a; void 阅读全文
posted @ 2022-04-25 21:26 new-code 阅读(34) 评论(0) 推荐(0) 编辑
摘要:于是他错误的点名开始了 https://www.luogu.com.cn/problem/P2580 #include<bits/stdc++.h> using namespace std; const int maxn=1e6+5; int son[30][maxn],idx=0; int cnt 阅读全文
posted @ 2022-04-19 16:56 new-code 阅读(20) 评论(0) 推荐(0) 编辑
摘要:排列组合分不清?17分钟讲清楚原理与使用 阅读全文
posted @ 2022-04-17 09:12 new-code 阅读(22) 评论(0) 推荐(0) 编辑
摘要:抽屉原理 抽屉原理2 有一道小学题目想不通?抽屉原理的通俗解释 抽屉插板法 秒杀排列大规模排列组合 阅读全文
posted @ 2022-04-17 08:29 new-code 阅读(142) 评论(0) 推荐(0) 编辑
摘要:堆的基本存储 https://www.runoob.com/data-structures/heap-storage.html 堆的 shift up https://www.runoob.com/data-structures/heap-shift-up.html 堆的 shift down ht 阅读全文
posted @ 2022-04-16 20:42 new-code 阅读(26) 评论(0) 推荐(0) 编辑
摘要:二分查找 二分查找也叫二分搜索 (binary search),也叫折半查找 (half-interval search),是一种在有序数组中查找特定元素的搜索算法。所以用二分查找的前提是数组必须是有序的. 模板1-匹配目标数据 int binarySearch(int a[], int left, 阅读全文
posted @ 2022-04-16 08:10 new-code 阅读(43) 评论(0) 推荐(0) 编辑
摘要:电子学会七级-数据结构-二叉树 二叉树的存储 二叉树的顺序存储 【深基16.例1】淘汰赛 https://www.luogu.com.cn/problem/P4715 #include <bits/stdc++.h> using namespace std; const int N = 7; int 阅读全文
posted @ 2022-04-14 11:35 new-code 阅读(22) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示