上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 29 下一页
摘要: 已通过洛谷模板:(【矩阵快速幂】、【行列式计算】) template<class T> struct Matrix { i64 N; vector<vector<T>> A; Matrix() : N(0) {} Matrix(int n) : N(n), A(n, vector<T>(n, 0)) 阅读全文
posted @ 2023-12-05 15:20 Ke_scholar 阅读(66) 评论(2) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; struct trie { int n; vector<array<int, 26>> trans; vector<int> cnt; trie() : n(0) { new_node(); } int ne 阅读全文
posted @ 2023-12-04 12:51 Ke_scholar 阅读(97) 评论(0) 推荐(0)
摘要: 哈尔滨华德学院-新生编程挑战赛 A-签到_哈尔滨华德学院-新生编程挑战赛(同步赛) (nowcoder.com) 签到 #include <bits/stdc++.h> #define debug(a) cout<<#a<<"="<<a<<'\n'; using namespace std; usi 阅读全文
posted @ 2023-12-03 17:03 Ke_scholar 阅读(41) 评论(0) 推荐(0)
摘要: A. Flipping Game 本质上是让我们找出一段区间内\(0\)的个数大于\(1\)的个数的最多的区间,且必须进行一次操作,所以可以考虑区间\(dp\),或者最小子序列和 1 最小子序列和 \[\begin{aligned} dp_i是以a_i结尾的最小子序列和 \\ dp_i=\min(d 阅读全文
posted @ 2023-12-02 16:01 Ke_scholar 阅读(51) 评论(0) 推荐(0)
摘要: B. BerSU Ball 排序后考虑\(dp\),\(dp_{i,j}\)表示前\(i\)个男生和前\(j\)个女生能匹配的最大数. \[\begin{aligned} if(|a_i - b_j| \le 1) \ dp_{i,j} = dp_{i-1,j-1} + 1 \\ else \ \ 阅读全文
posted @ 2023-12-02 14:42 Ke_scholar 阅读(45) 评论(0) 推荐(0)
摘要: 二分图最大匹配模板(匈牙利算法) P3386 【模板】二分图最大匹配 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) struct augment_path { vector<vector<int> > g; vector<int> pa; // 匹配 vector<int> pb 阅读全文
posted @ 2023-12-02 12:32 Ke_scholar 阅读(86) 评论(0) 推荐(0)
摘要: struct EulerSieve { private: int n; vector<int> phi; // 欧拉函数数组 vector<int> mu; // 莫比乌斯函数数组 vector<int> nextp; // 最小质因子数组 vector<int> prime; // 素数列表 ve 阅读全文
posted @ 2023-11-30 17:48 Ke_scholar 阅读(77) 评论(2) 推荐(0)
摘要: KEYENCE Programming Contest 2023 Autumn(AtCoder Beginner Contest 325) - AtCoder E E - Our clients, please wait a moment (atcoder.jp)(分层图最短路) 因为只能从坐公司汽 阅读全文
posted @ 2023-11-30 01:52 Ke_scholar 阅读(57) 评论(0) 推荐(0)
摘要: Codeforces Round 911 (Div. 2) D D. Small GCD 题意 定义\(f(a,b,c)\)为\(a,b,c\)中较小两个数的\(gcd\),给定数组\(a_{1...n}\),求 \[\begin{aligned} \sum\limits_{i=1}^{n}\sum 阅读全文
posted @ 2023-11-28 20:41 Ke_scholar 阅读(90) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; template <typename T> class SparseTable { using VT = vector<T>; using VVT = vector<VT>; using func_type 阅读全文
posted @ 2023-11-26 01:51 Ke_scholar 阅读(89) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 29 下一页