HDU 5125 序列型DP

博客介绍了如何解决HDU 5125题目,该题目要求找到序列A的最长上升子序列,允许最多M个元素被B中对应位置的元素替换。解题策略是使用动态规划(DP),考虑从A或B的前一个状态转移过来,总共有4种情况,列出相应的转移方程,强调了问题的复杂性和数据范围限制,以及解题需要注意的细节。
摘要由CSDN通过智能技术生成

【题目链接】
http://acm.hdu.edu.cn/showproblem.php?pid=5125

【解题报告】
求A的最长上升子序列,其中A中至多有M个元素可以被B中同位置元素替换。
考虑到数据范围只有1e3,所以完全可以用O(n^2)的方法来求LIS,但是由于有了B数组的加入,所以我们需要考虑Dp的状态要设置两个,一个是从上一个状态的a转移过来,一个是从上一个状态的b转移过来。
所以转移方程一共有2×2种情况,分类讨论列写转移方程即可。并没有太多难点,细心即可。

【参考代码】

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;

int dp[1000+100][
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
QCC5125 VFBGA is a system on-chip (SoC) with on-chip Bluetooth, audio and programmable application processor. It includes high-performance, analog, and digital audio codecs, Class-AB and Class-D audio drivers, advanced power management, Li-ion battery charger, light-emitting diode (LED) drivers, and flexible interfaces including interintegrated circuit sound (I²S), inter-integrated circuit interface (I²C), universal asynchronous receiver transmitter (UART), and programmable input/output (PIO). An application-dedicated Developer Processor and a system Firmware Processor run code from an external quad serial peripheral interface (QSPI) flash. Both processors have tightly coupled memory (TCM) and an on-chip cache for performance while executing from external flash memory. The system Firmware Processor provides functions developed by Qualcomm Technologies International, Ltd. (QTIL). The Developer processor provides flexibility to the product designer to customize their product. The Audio subsystem contains a programmable Kalimba core running Qualcomm® Kymera™ system DSP architecture framework from read only memory (ROM). A range of audio processing capabilities are provided from ROM which are configurable in fully flexible audio graphs. In built capabilities in ROM, may be complimented or replaced by capabilities run from random access memory (RAM), including those provided by QTIL, the product designer or third parties. The flexibility provided by the fully programmable applications processor plus the ability to configure and program the audio processors enables manufacturers to easily differentiate products with new features. QCC5125 VFBGA is driven by a flexible, software platform with powerful integrated development environment (IDE) support. This enables rapid time-to-market deployment for a broad range of consumer electronic products, including audio, wireless speaker, Qualcomm TrueWireless, and broadcast audio for stereo speaker arrangements.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值