Warning: session_start(): open(/tmp/sess_d1fb9e7a115567aa7ace26ebe97468ef, O_RDWR) failed: No space left on device (28) in /data/wiki/inc/init.php on line 239

Warning: session_start(): Failed to read session data: files (path: ) in /data/wiki/inc/init.php on line 239

Warning: Cannot modify header information - headers already sent by (output started at /data/wiki/inc/init.php:239) in /data/wiki/inc/auth.php on line 430
Writing /data/wiki/data/cache/4/43994124a9168f34c03db2ff7cd35d94.captchaip failed

Warning: Cannot modify header information - headers already sent by (output started at /data/wiki/inc/init.php:239) in /data/wiki/inc/actions.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at /data/wiki/inc/init.php:239) in /data/wiki/lib/tpl/dokuwiki/main.php on line 12
2020-2021:teams:legal_string:jxm2001:dp套dp [CVBB ACM Team]

用户工具

站点工具


2020-2021:teams:legal_string:jxm2001:dp套dp

到此差别页面的链接

后一修订版
前一修订版
2020-2021:teams:legal_string:jxm2001:dp套dp [2021/08/25 21:15]
jxm2001 创建
2020-2021:teams:legal_string:jxm2001:dp套dp [2021/08/25 22:05] (当前版本)
jxm2001
行 13: 行 13:
 === 题意 === === 题意 ===
  
-给定一个长度为 $n$ 的字符串 $S$。对 $i=0\sim n$,求有多少长度为 $m$ 的 $T$ 满足 $\text{LCS}(S,​T)=i$。其中 ​$S,T$ 只含 ​$\text{ATGC}$。+给定一个长度为 $n$ 的字符串 $S$。对 $i=0\sim n$,求有多少长度为 $m$ 的 $T$ 满足 $\text{LCS}(S,​T)=i$。其中字符集为  
 + $\text{ATGC}$。
  
 === 题解 === === 题解 ===
行 116: 行 117:
 </​hidden>​ </​hidden>​
  
 +
 +==== 例题二 ====
 +
 +[[https://​www.luogu.com.cn/​problem/​P4590|洛谷p4899]]
 +
 +=== 题意 ===
 +
 +给定一个长度为 $n$ 的字符串 $S$。对 $i=0\sim n$,求有多少长度为 $m$ 的 $T$ 满足 $\text{LCS}(S,​T)=i$ 且 $T$ 不含 $\text{NOI}$ 子串。其中字符集为 $\text{NOI}$。
 +
 +=== 题解 ===
 +
 +模拟 $\text{KMP}$ 记录 $T$ 与 $\text{NOI}$ 的匹配情况即可,也是一个自动机,本题该状态可任意放在内/​外层 $\text{dp}$ 维护。但是状态比较复杂时建议放在内层维护。
2020-2021/teams/legal_string/jxm2001/dp套dp.1629897328.txt.gz · 最后更改: 2021/08/25 21:15 由 jxm2001