摘要: 同余定理; 逆元的线性递推: 线性同余: 中国剩余定理: 组合数 大数质因子分解 欧拉函数 积性函数及其筛法: 阅读全文
posted @ 2020-09-20 01:36 GoodVv 阅读(149) 评论(0) 推荐(1) 编辑
摘要: 快速幂 ll pow_mod(ll x,ll n,ll mod){ll res=1;while(n){if(n&1)res=res*x%mod;x=x*x%mod;n>>=1;}return res;}//xµÄn´Î·½mod template<typename T>void read(T &re 阅读全文
posted @ 2020-09-18 15:14 GoodVv 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 事务 MYSQL为什么要有事务?或者说,事务是用来解决什么问题的? 阅读全文
posted @ 2022-03-23 15:47 GoodVv 阅读(23) 评论(0) 推荐(0) 编辑
摘要: MYSQL为什么要有事务?或者说,事务是用来解决什么问题的? 举一个最经典的样例: 假设进行银行转账,A的账户扣除50元,B的账户增加50元,对应的sql语句如下 update table set cost = cost - 50 where id = 'A';///step 1 update ta 阅读全文
posted @ 2022-03-23 15:40 GoodVv 阅读(1006) 评论(0) 推荐(0) 编辑
摘要: sprite mode —— 精灵模式 multiple —— 倍数 pixels —— 像素 normalized —— 正常化 platform —— 平台 edge collider ——边缘碰撞 box collider —— 盒子碰撞器/碰撞检测器 platform effector —— 阅读全文
posted @ 2021-08-07 00:07 GoodVv 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 链接 题意: 给定一个数组,每次从数组中拿两个数A 、B出来,再放一个数C进去,且C = min(A , B) 或者 C = gcd(A , B),问剩下的最后一个数有多少种可能。 思路: 假设数组为 a[ ] 首先,如果对所有的数取min的话,那么留下来的一定是最小的那个。 其次,对于一个式子 C 阅读全文
posted @ 2021-02-10 02:59 GoodVv 阅读(103) 评论(0) 推荐(1) 编辑
摘要: 题目链接 本题解参考这里 积性函数及筛法参考这里 欧拉反演参考这里 思路: 代码: #include<bits/stdc++.h> using namespace std; #define int long long #define pb push_back const int maxn = 1e6 阅读全文
posted @ 2021-01-24 02:24 GoodVv 阅读(72) 评论(0) 推荐(1) 编辑
摘要: 题目链接 思路: 首先很容易想到算 i 的贡献,比如 [ L , R] = [5 , 15] , 那么数字 3 在这段区间的贡献c次数就是 15 / 3 - (5 - 1) / 3 = 4 所以可以: int l , r; cin >> l >> r; l --; int ans = 0; for( 阅读全文
posted @ 2021-01-18 16:00 GoodVv 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 题目链接 自己写给自己看的,题解看这里 代码: #include<bits/stdc++.h> using namespace std; #define int long long #define ll long long #define pb push_back const int maxn = 阅读全文
posted @ 2021-01-17 23:01 GoodVv 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 代码: #include<iostream> #include<map> #include<vector> #include<algorithm> using namespace std; #define int long long #define debug(a) cout << #a << ' 阅读全文
posted @ 2021-01-13 03:32 GoodVv 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 题目链接 题目 思路 最开始的思路: 把A拆成 \(a_1 \times a_2\) , 那么$AB$ 就变成了$a_1B \times a_2^B$ ,那么$a1$和$a2$能提供的因子(约数)有: \(a_1^0\) , \(a_1^1\) , \(a_1^2\) \(\cdots a_1^B\ 阅读全文
posted @ 2020-10-28 17:40 GoodVv 阅读(113) 评论(0) 推荐(0) 编辑
摘要: E. Two Round Dances 题意: 把n个人分成两个圆排列,问有几种方法。 思路: 看到圆排列想到第一类斯特林数 首先先从n个数中选出n / 2 > C(n , n / 2) 然后对两个部分: 第一个 n / 2 排成一个圆排列的个数:S1(n / 2 , 1) = (n / 2 - 1 阅读全文
posted @ 2020-10-21 02:24 GoodVv 阅读(131) 评论(1) 推荐(0) 编辑