摘要: CF1477D Nezzar and Hidden Permutations 首先考虑将每一个数对 \((u,v)\) 看成一条 \(u\) 向 \(v\) 的连边。若此时有一个点 \(u\) 和其他点均有连边,则 \(p\) 中第 \(u\) 个位置上的数和 \(q\) 上第 \(u\) 个位置上 阅读全文
posted @ 2026-05-15 09:23 stuart220_chen 阅读(23) 评论(0) 推荐(1)
摘要: 知识点 1.决策单调性优化 \(dp\) 决策单调性优化 \(dp\) ,主要用于优化 \(1D/1D\) 类 \(dp\),比如类似于 \(dp_i=min_{j=1}^{i-1}dp_j+w(j,i)\) 或是 \(dp_i=min_{j=1}^{i-1}g_j+w(j,i)\),其中 \(w\ 阅读全文
posted @ 2026-05-12 18:21 stuart220_chen 阅读(19) 评论(0) 推荐(0)
摘要: 缺省源 #include<bits/stdc++.h> using namespace std; #define il inline #define int long long bool St; struct IO { static const int Size=(1<<21); char buf[ 阅读全文
posted @ 2026-05-01 15:42 stuart220_chen 阅读(7) 评论(0) 推荐(0)
摘要: CF1239E. Turtle 神秘贪心+dp题。 首先假设第一行和第二行所选的数已经定了,只用考虑摆放顺序。 设\(w_i\)为从第\(i\)行拐入第二行的答案。 对于第一行,假设有\(a_{1,i}>a_{1,i+1}\)时,交换\(a_{1,i}\)和\(a_{1,i+1}\),发现此时\(w 阅读全文
posted @ 2026-04-30 17:22 stuart220_chen 阅读(6) 评论(0) 推荐(0)
摘要: level 0: P6328 我是仙人掌 bitset简单题,用bitset+bfs维护一下与1-n中每个节点不超过x的节点有哪些,求答案时或起来就好了。 代码: #include<bits/stdc++.h> using namespace std; #define il inline #defi 阅读全文
posted @ 2026-04-30 15:50 stuart220_chen 阅读(16) 评论(1) 推荐(0)
摘要: 1.当\(f(x)=a\times f(x-1)+b\times f(x-2)\)(\(a\),\(b\)互质)时,$gcd(f(x),f(y))=f(gcd(x,y)) $ 证明: \[f(0)=0,f(1)=1,f(2)=a\\ \begin{bmatrix} f(n)&f(n-1) \end{ 阅读全文
posted @ 2026-03-31 17:57 stuart220_chen 阅读(19) 评论(0) 推荐(0)