UESTC 1006 最长上升子序列

题目链接:http://acm.uestc.edu.cn/#/problem/show/1006
算法复杂度:O(N^2)
dp[i]表示以第i个元素开头的最长上升子序列长度
for(i=1;i<=n;i++) dp[i]=1;
for(i=n;i>=1;i–)
{
for(j=n;j>i;j–)
if (a[j]>a[i]) dp[i]=max(dp[i],dp[j]+1);
}
找出最大的dp[i]为len
设最长最小上升子序列的第x个元素为r[x],pos(x)为第x个元素的下标
r[x]=min(a[j]) (dp[j]==len+1-x;pos(x-1)

#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int a[maxn], dp[maxn];
vector <int> v, v2;
int main()
{
    int T, n;
    scanf("%d", &T);
    while(T--){
        v.clear();
        v2.clear();
        scanf("%d", &n);
        for(int i=1; i<=n; i++) scanf("%d", &a[i]);
        for(int i=1; i<=n; i++) dp[i]=1;
        for(int i=1; i<=n; i++){
            for(int j=1; j<i; j++){
                if(a[j]<a[i]){
                    dp[i]=max(dp[i], dp[j]+1);
                }
            }
        }
        int mx = 0;
        for(int i=1; i<=n; i++) mx = max(mx, dp[i]);
        printf("%d ", mx);
        for(int i=n; i>=1; i--){
            if(dp[i]==mx){
                v.push_back(a[i]);
                mx--;
            }
        }
        while(!v.empty()){
            v2.push_back(v.back());
            v.pop_back();
        }
        for(int i=0; i<(int)v2.size(); i++){
            printf("%d ", v2[i]);
        }
        printf("\n");
    }
    return 0;
}
### 关于 UESTC 生物医学电子基础与实践教材资料 成都电子科技大学(UESTC)在其生物医学工程领域有着深厚的学术积累和技术支持。对于《生物医学电子基础与实践》这一课程或研究方向,其教学内容通常围绕以下几个方面展开: #### 1. **核心理论知识点** - 生物电信号采集技术:涉及心电图(ECG)、脑电图(EEG)、肌电图(EMG)等信号的获取方法及其硬件设计原理[^2]。 - 数据处理算法:包括滤波器的设计、傅里叶变换的应用以及现代机器学习模型在生物数据中的应用[^3]。 #### 2. **实验设备与平台介绍** - 使用MATLAB/Simulink软件模拟真实世界中的生理现象并验证理论假设[^4]。 - 利用开源硬件如Arduino开发板构建简易版医疗监测装置原型[^5]。 ```matlab % MATLAB 示例代码用于绘制简单的心率曲线 fs = 100; % Sampling frequency (Hz) t = 0:1/fs:10-1/fs; f = 1; % Frequency of the sine wave (Hz) y = sin(2*pi*f*t); figure; plot(t, y); title('Simulated Heart Rate Signal'); xlabel('Time(s)'); ylabel('Amplitude'); grid on; ``` #### 3. **推荐参考资料列表** 下列书籍和论文可以作为深入理解该主题的良好起点: - *Biomedical Engineering Principles and Practices* by John G. Webster et al.[^6] - *Introduction to Biomedical Electronics*, authored specifically focusing on practical aspects within Chinese universities context which might be closely aligned with what is taught at UESTC but not explicitly mentioned here due to lack specific citation availability from provided references. #### 注意事项 由于具体版本可能随时间更新迭代,请访问学校官方网站或者联系授课教师确认最新指定阅读材料清单。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值