2024年7月27日
摘要: vj4补题 线段树+multiset(buhui) 原文链接:https://blog.csdn.net/m0_64158084/article/details/127790615 补充)set和mutiset 一个自动去重,一个不去重。 字典树/map 题目:给你一个N x N的矩阵,矩阵由小写字 阅读全文
posted @ 2024-07-27 09:21 Hoshino1 阅读(2) 评论(0) 推荐(0) 编辑
  2024年7月25日
摘要: 1. vj团队赛3补题(上午 vj题解 https://blog.nowcoder.net/n/33590b62f85540cba97c55026be98480 https://www.cnblogs.com/ch-hui/p/12767416.html 代码板子 #include<bits/std 阅读全文
posted @ 2024-07-25 21:51 Hoshino1 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 算法竞赛(差分)(上午) 初始化 #include <algorithm> int arr[100]; std::fill(arr, arr + 100, 0); //比memset更高效 int arr[100] = {}; // 所有元素都初始化为 0 栈溢出 为局部变量每次运行时都在运行栈中分 阅读全文
posted @ 2024-07-25 18:48 Hoshino1 阅读(1) 评论(0) 推荐(0) 编辑
  2024年7月24日
摘要: 算法竞赛(二分) (上午) 图论+二分 P1462 //邻接表实现无边权 vector<int> g[maxn]; g[x]push_back(y); g[y]push_back(x); //边权实现 #include <vector> using namespace std; const int 阅读全文
posted @ 2024-07-24 09:34 Hoshino1 阅读(1) 评论(0) 推荐(0) 编辑
  2024年7月23日
摘要: 基础算法复习 (上午) 双指针 一本书P页,第i页有知识点ai,同一个知识点可能多次提到,希望通过连续的一些页把所有知识点都覆盖到。求出连续的最少页数 #include <iostream> #include <algorithm> #include <cmath> #include <set> # 阅读全文
posted @ 2024-07-23 20:46 Hoshino1 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1.回看7.18-7.20总结 map和pair- #include <iostream> #include <vector> using namespace std; const int maxn = 10; vector<pair<int, int>> q[maxn]; int main() { 阅读全文
posted @ 2024-07-23 08:34 Hoshino1 阅读(1) 评论(0) 推荐(0) 编辑
  2024年7月20日
摘要: 上午 vjcon3补题 vj3 优先队列维护贪心 取一个数的各位只需要 a/100%10,a/10%10,a%10; 去重 bool(int n) { set<int>st; for(int j=0;j<n;j++) { st.insert(a[i][j]); } if(st.size()!=n) 阅读全文
posted @ 2024-07-20 16:29 Hoshino1 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 上午:contest2补题; 下午:vj比赛 晚上:acwing数学约数+最短路问题。 约数个数 const int mod=1e9+7,998244353 for(int i=2; i<=x; i++) { while(x%i==0) { x/=i; primes[i]++; } if(x>1) 阅读全文
posted @ 2024-07-20 08:03 Hoshino1 阅读(2) 评论(0) 推荐(0) 编辑