摘要: 一般ACM或者笔试题的时间限制是1秒或2秒。 在这种情况下,C++代码中的操作次数控制在 107108 为最佳。 下面给出在不同数据范围下,代码的时间复杂度和算法该如何选择: n30, 指数级别, dfs+剪枝,状态压缩dp n100 => O(n3),$floy 阅读全文
posted @ 2023-02-13 10:04 wqzgg 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 贝祖数 公式:ax+by=m(a,b,mZ) 求x,y 贝祖定理 例:2x+y=3 有整数解 因为 2 和 1 的最大公约数是 1 而3是1的整数倍 4x+2y=5 无整数解 因为 4 和 2 的最大公约数是 2 而5不是2的整数倍 贝祖数 例:$104x+4 阅读全文
posted @ 2023-02-06 22:24 wqzgg 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 最大公约数 1.图解:求40与104的最大公约数 gcd(40,104)=8 2.例: $ 104 \div 40 = 2 \cdot\cdot\cdot\cdot\cdot\cdot 24 \ 40 \div 24 = 1 \cdot\cdot\cdot\cdot\cdot\cdot 1 阅读全文
posted @ 2023-02-06 21:50 wqzgg 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 唯一分解定理 n=si=1piai=p1a1p2a2···psas 莫比乌斯函数的定义 $$ \mu (n) = \left{ \begin{aligned} & 1 & & n = 1\ & 0 阅读全文
posted @ 2023-02-06 11:20 wqzgg 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 1.希腊字母 | 字母 | 实现 | | | | | α | \alpha | | β | \beta | | γ | \gamma | | δ | \delta | | ϵ | \epsilon | | $\varepsilo 阅读全文
posted @ 2023-01-28 20:41 wqzgg 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 如果n能被i整除i就是约数 #include <bits/stdc++.h> using namespace std; vector<int> get_divisors(int n) { vector<int> res; for (int i = 1; i <= n / i; i ++ ) { if 阅读全文
posted @ 2023-01-27 19:30 wqzgg 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 是求(a^b) mod p 如果用暴力解法 O(b) 点击查看TLE代码c++ #include<iostream> using namespace std; int main() { int a,b,p; long long res=1; cin>>a>>b>>p; while(b--) res 阅读全文
posted @ 2023-01-26 21:58 wqzgg 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 这就是我-->这就是我-->这就是我-->这就是我--> AC:Accemble,粗劣的答案。 PC:Personal Correct 个人的答案。 WA:Wonderful Answer 优秀的答案。 RE:Compile Exactness 运行正确。 TLE:Time Limit Enrich 阅读全文
posted @ 2023-01-26 21:11 wqzgg 阅读(252) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示