![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
DoIdo~
这个作者很懒,什么都没留下…
展开
-
模板——exLucas(大组合数取模)
```cpp#include<iostream>#include<algorithm>using namespace std;typedef long long ll;const int N = 20;ll B[N], u[N];inline ll qmul(ll a, ll b, ll p) { ll res = 0; a %= p; b %= p; while (b) { if (b & 1LL) { res = (res + a) %原创 2020-09-11 16:24:17 · 125 阅读 · 0 评论 -
赛后题解——问题 C: A^X mod P
问题 C: A^X mod P题目描述It’s easy for ACMer to calculate A^X mod P. Now given seven integers n, A, K, a, b, m, P, and a function f(x) which defined as following.f(x) = K, x = 1f(x) = (a*f(x-1) + b)%m , x > 1Now, Your task is to calculate( A^(f(1)) + A原创 2020-09-06 10:00:29 · 192 阅读 · 0 评论 -
算法——数位dp
注释:数位dp解决的问题:求出给定区间[L,R]\small [L,R][L,R],符合条件f(x)\small f(x)f(x)的xxx的数量。例:条件:不降数——这种数字必须满足从左到右各位数字成小于等于的关系。如 123\small 123123,446\small446446L\small LL:1\small 11R\small RR:19\small 1919答案:18\small 1818解释:只有10\small 1010不是不降数,其余的数都是不降数,故答案为18\sma..原创 2020-07-16 07:48:56 · 160 阅读 · 2 评论 -
算法——判断二分图
注释:算法核心:若一个图是二分图,则它的充要条件是所有回路都是偶数,即每个回路可以用两种颜色染色,即该图可以用两种颜色染色,可以直接用dfs\small dfsdfs染色判断是否可以用两种颜色染色。演示图解:代码...原创 2020-07-08 00:46:45 · 966 阅读 · 0 评论