题解
题解 P7809【[JRKSJ R2] 01 序列】
Link 算法 1 针对 Subtask 1。 显然对于询问 1,答案为 r-l+1,对于询问 2,答案为 1。 时间复杂度 O(n+m)。期望得分 5pts。 算法 2 暴力求区间最长不降/上升子序列,时间复杂度 O(mn^2)。期望得分 10pts,结合算法 1 可得 15p…
365127
Not yet for the story on the last page, it's not the end.
Link 算法 1 针对 Subtask 1。 显然对于询问 1,答案为 r-l+1,对于询问 2,答案为 1。 时间复杂度 O(n+m)。期望得分 5pts。 算法 2 暴力求区间最长不降/上升子序列,时间复杂度 O(mn^2)。期望得分 10pts,结合算法 1 可得 15p…
Link 题意 给定三个长为 n 的数组 a_0,…,n-1,b_0,…,n-1,c_0,…,n-1,对 forall i∈[0,n-1] 求出: 对 998244353 取模。 n≤ 2.5× 10^5。 思路 将 a,b 看成常量,那么 d 就是由 c 的线性变换得来,我们考…
已经到底了