考虑DP. 如果把转移看出当前位填什么数的话,这样是有后效性的. 如果考虑当前的序列是将1至n依次插入序列中的话. 考虑将i插入1到i-1的序列中,如果插入到<号中或者首部,那么最后就会多出一个大于号. 如果插入到>号中或者尾部,那么最后就会多出一个小于号. 所以定义状态dp[i][j]表示1到i组成的序列中,小于号的数目为j的方法数.转移方程即为所求. # include <cstdio> # include <cstring> # include <cstdl…
题目描述 Everyone knew it would only be a matter of time. So what? Faced for years on, a peril becomes the every-day reality. It loses its meaning... Today the letter of the Bitotian char Bittard to the Byteotian king Byteasar was released to the public.…