160D

[ARC160D] Mahjong

Solution 首先判掉 \(k\nmid m\) 时显然无解的情况。 然后考虑倒着做,往序列上加,那么有显然的 \(dp\),记 \(f_{i,j}\) 表示考虑前 \(i\) 个位置,总共做了 \(j\) 次操作的方案数,转移的时候将区间加操作钦定在最后一个位置统计,暴力枚举操作的数量即可转移 ......
Mahjong 160D ARC 160

CF Edu160D Array Collapse

可以操作任意多次。考虑 dp。 设 \(dp_i\) 表示考虑前 \(i\) 个位置之后,强制最终留下第 \(i\) 个位置上的数的方案数,转移时枚举前面的位置 \(j\),对于合法的决策 \(j\),显然需满足 \(\forall k\in(j,i)\),\(a_k>a_i\) 或 \(a_k>a ......
Collapse Array 160D 160 Edu

[CF160D] Edges in MST

Description You are given a connected weighted undirected graph without any loops and multiple edges. Let us remind you that a graph's spanning tree i ......
Edges 160D 160 MST CF
共3篇  :1/1页 首页上一页1下一页尾页