摘要:
https://www.acwing.com/problem/content/description/171/ 舞蹈链还是比较好,抄了一个看起来可以改的模板? cpp include include include using namespace std; const int inf = ( 1u 阅读全文
摘要:
https://www.acwing.com/problem/content/133/ 单调栈的模板题,按道理悬线dp不用的话也可以这样做。 需要注意这道题不能直接dp,比如[3,5,4],这组数据,3可以拓展5,但5不能拓展4,不过3可以拓展4。 cpp include using namespa 阅读全文
摘要:
https://www.acwing.com/problem/content/154/ 悬线法dp,悬线dp,不知道这样对不对,反正能过,看看别人的证明: 纯dp的方法就是这样:预处理每个点向左、向右的扩展距离,然后统一处理向上的扩展距离。 include using namespace std; 阅读全文
摘要:
https://ac.nowcoder.com/acm/contest/1099 question I 2019 点分治,第一次做的点分治。要先找树的重心,然后分治。 cpp include using namespace std; typedef long long ll; const int I 阅读全文
摘要:
```cpp const int MOD = 10007; ll n, m; ll qpow(ll x, ll n) { ll res = 1; while(n) { if(n & 1) res = res * x % MOD; x = x * x % MOD; n >>= 1; } ret... 阅读全文