摘要: acwing52周赛 题目链接 1.智力测试 算法(暴力枚举) \(O(n)\) 枚举即可,直到大于所给值就退出,并且减一即为答案。 C++ 代码 #include<iostream> #include<vector> #include<queue> #include<stack> #include<algorithm> 阅读全文
posted @ 2022-05-21 23:58 knowei 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 算法模板 a.位运算 1.快速幂 ll qmi(int m, int k, int p) { ll res = 1 % p, t = m; while (k) { if (k&1) res = res * t % p; t = t * t % p; k >>= 1; } return res; } b.前缀和 阅读全文
posted @ 2022-05-21 14:57 knowei 阅读(25) 评论(0) 推荐(0) 编辑