摘要: 题目 "戳这里" 。 最长下降子序列单调队列求法。 $f_{i,j,k}$表示考虑前$i$个数,$g_1 = j,g_2 = k$的方案数。转移: $$f_{i,j,k} = \sum_{p = k+1}^{j}f_{i 1,p,k}+\sum_{p=0}^kf_{i 1,j,p}$$ 二维前缀和优 阅读全文
posted @ 2017-02-15 23:30 lmxyy 阅读(341) 评论(0) 推荐(0) 编辑
摘要: 题目 "戳这里" 。 找规律。 每一列占据的格子一定是一段区间; 相邻列之间的区间有交。 上界先增后减,下界先减后增。 $f_{i,j,k,0/1,0/1}$表示考虑前$i$列,第$i$列,上界为$j$下界为$k$且上界正在上升/下降,下界正在上升/下降的方案数。转移请自行YY。 include i 阅读全文
posted @ 2017-02-15 23:26 lmxyy 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 题目 "戳这里" 。 村庄排序。状态$f[j][i]$表示考虑前$i$个村庄,造$j$个邮局且$i$造了邮局的最小代价。我们用$Lb_i,Rb_i$表示在第$i$个村庄造邮局,邮局最左和最右能够服务到的村庄。$pre_i$表示$P$的前缀和。 $$f[j][i] = C_i + \left\{ \b 阅读全文
posted @ 2017-02-15 23:22 lmxyy 阅读(264) 评论(0) 推荐(0) 编辑
摘要: Description Petya puts the $N$ white balls in a line and now he wants to paint some of them in black, so that at least two black balls could be found 阅读全文
posted @ 2017-02-15 23:17 lmxyy 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Description There are $M$ network interfaces in the wall of aisle of library. And $N$ computers next to the wall need to be connected to the network. 阅读全文
posted @ 2017-02-15 23:12 lmxyy 阅读(192) 评论(0) 推荐(0) 编辑
摘要: Description John has $n$ light bulbs and a switchboard with $n$ switches; each bulb can be either on or off, and pressing the $i$ th switch changes th 阅读全文
posted @ 2017-02-15 23:07 lmxyy 阅读(316) 评论(0) 推荐(0) 编辑