摘要:
归并排序: include define ll long long using namespace std; const int maxn = 500001; ll a[maxn], s[maxn], ans = 0, n;//ans用来记录逆序对数量 void merge_sort(ll l,ll 阅读全文
摘要:
题目链接:https://www.luogu.org/problemnew/show/P1983 符合了NOIP命题的特点,知识点不难,思维量是有的。 step1:把题读进去,理解。得到 非停靠点的等级 include include include include using namespace 阅读全文
摘要:
题目链接:https://www.luogu.org/problemnew/show/P1879 状压DP。 设dp[i][j]表示第i行,状态为j的方案数 初始dp[0][0] = 1 这样一共12行12列,最多1 include include include define ll long lo 阅读全文
摘要:
考试题。 是个DP。 50分可以通过子集枚举+线段覆盖(贪心)完成。 考试没时间写了一个子集枚举30分。 include include include include include using namespace std; const int maxn = 1e6 + 10; inline in 阅读全文
摘要:
题目链接:https://www.luogu.org/problemnew/show/P1850 难的不在状态上,难在转移方程。 (话说方程写错居然还有84分= =) include include include include define ll long long using namespac 阅读全文
摘要:
题目链接:https://www.luogu.org/problemnew/show/P1558 我知道三十棵线段树很暴力,可是我们可以状压啊。 颜色最多30,不会爆int 另外 吐槽评测机 include include include include using namespace std; c 阅读全文
摘要:
题目链接:https://www.luogu.org/problemnew/show/P3258 谁说树剖过不去会RE呢? 我今天就是要强行树剖了 树剖强艹 include include include include define ll long long using namespace std 阅读全文
摘要:
题目链接:https://www.luogu.org/problemnew/show/P3959 我只是心血来潮想学SA(考场上骗分总行吧)。 这个题可以状压DP、爆搜+剪枝、有意思的还是随机化搜索(是的,这个题用的不叫SA,没有降温)。 code: include include include 阅读全文