默写课文。。。
导数公式:
原函数 | 导函数 |
---|---|
$ y = C(C为常数) $ | $ y’ = 0 $ |
$ y = a^x $ | $ y’ = a^x \ln a $ |
$ y = e^x $ | $ y’ = e^x $ |
$ y = x^n $ | $ y’ = nx^{n - 1} $ |
$ y = \log_{a}x $ | $ y’ = \frac{1}{x \ln a} $ |
$ y = \ln x $ | $ y’ = \frac{1}{x} $ |
$ y = \sin x $ | $ y’ = \cos x $ |
$ y = \cos x $ | $ y’ = - \sin x $ |
$ y = u \pm v $ | $ y’ = u’ \pm v’ $ |
$ y = uv $ | $ y’ = u’v + uv’ $ |
$ y = \frac{u}{v} $ | $ y’ = \frac{u’v - uv’}{v^2} $ |
$ y = f(g(x)) $ | $ y’ = g’(x)f’(g(x)) $ |
完整代码:
1 | inline int Max(const int &x, const int &y) { return x > y ? x : y; } |
NTT(Mul&ntt)
1 | inline int Get(int x) { int ss = 1; for(; ss <= x; ss <<= 1); return ss; } |
牛顿迭代:
推导:
求逆(Inv):
1 | vector<int> Inv(const vector<int> &A, int sz = -1) { |
求Ln(Ln):
1 | vector<int> Ln(const vector<int> &A) { |
求Exp(Exp):
1 | vector<int> Exp(const vector<int> &A, int sz = -1) { |
多项式快速幂(Ksm):
这种做法也可以用来多项式开根。。。
1 | vector<int> Ksm(const vector<int> &A, const vector<int> &K) { |
Update:
1 | vector<int> Ksm(const vector<int> &A, const int &K) { |
开方(Sqrt):
1 | vector<int> Sqrt(const vector<int> &A, int sz = -1) { |