当前位置:网站首页>ZOJ - 4114 Flipping Game-dp,合理状态表示
ZOJ - 4114 Flipping Game-dp,合理状态表示
2022-07-25 15:23:00 【塔子哥来了】
题目大意:
给你两个长度为 n ( n ≤ 100 ) n(n \leq 100) n(n≤100)的01字符串.你需要进行 k ( k ≤ 100 ) k(k \leq 100) k(k≤100)轮操作,每次操作要选择 m ( m ≤ n ) m(m\leq n) m(m≤n)个字符,将其反转。
问你有多少种方案使得 k k k轮之后使得第一个字符串转变成第二个字符串.
题目思路:
K轮之后,两个字符串相等。那么我们只需要记录当前进行到第几轮且有几个字符串不相等即可.
所以定义 d p ( i , j ) dp(i,j) dp(i,j) 为前 i i i轮,当前局面有恰好 k k k个与第二个字符串不同的字符的方案数.
d p ( i , j − k + m − k ) + = C j k C n − j m − k d p ( i − 1 , j ) dp(i,j-k+m-k)+=C_{j}^{k}C_{n-j}^{m-k}dp(i-1,j) dp(i,j−k+m−k)+=CjkCn−jm−kdp(i−1,j)
边栏推荐
- Application of C language array in Sanzi chess -- prototype of Queen n problem
- CGO is realy Cool!
- Outline and box shadow to achieve the highlight effect of contour fillet
- Spark获取DataFrame中列的方式--col,$,column,apply
- Args parameter parsing
- Yan required executor memory is above the max threshold (8192mb) of this cluster!
- Word 样式模板复制到另一文档
- 在网页上实现任意格式的音视频快速播放功能的开发总结。
- Ml speech depth neural network model
- ML - 语音 - 语音处理介绍
猜你喜欢

小波变换--dwt2 与wavedec2

谷歌云盘如何关联Google Colab

window系统黑窗口redis报错20Creating Server TCP listening socket *:6379: listen: Unknown error19-07-28

JVM知识脑图分享

4PAM在高斯信道与瑞利信道下的基带仿真系统实验

Outline and box shadow to achieve the highlight effect of contour fillet

Run redis on docker to start in the form of configuration file, and the connection client reports an error: server closed the connection

Application of object detection based on OpenCV and yolov3

MySQL transactions and mvcc

Idea eye care settings
随机推荐
Idea remotely submits spark tasks to the yarn cluster
JVM-参数配置详解
ML - natural language processing - Introduction to natural language processing
matlab 优化工具 manopt 安装
ML - 图像 - 深度学习和卷积神经网络
期货在线开户是否安全?去哪家公司手续费最低?
How to solve the login problem after the 30 day experience period of visual stuido2019
UIDocumentInteractionController UIDocumentPickerViewController
Idea eye care settings
Hbck 修复问题
args参数解析
MATLAB 如何生产随机复序列
你准备好脱离“内卷化怪圈”了吗?
如何更新更新数据库中的json值?
JVM dynamic bytecode technology details
盒子躲避鼠标
Browser workflow (Simplified)
See a lot of blinking pictures on apps, especially the member page
Vscode plugin collection
CGO is realy Cool!