hdu 1087 Super Jumping! Jumping! Jumping!(dp+最长递增序列)

ZYNQ 系统的IEEE1588 实现方法 zynq IEEE588/PTP 实现方案(讨论稿) 阅读详情

Super Jumping! Jumping! Jumping!

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 14615    Accepted Submission(s): 6145


Problem Description
Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.



The game can be played by two or more than two players. It consists of a chessboard(棋盘)and some chessmen(棋子), and all chessmen are marked by a positive integer or “start” or “end”. The player starts from start-point and must jumps into end-point finally. In the course of jumping, the player will visit the chessmen in the path, but everyone must jumps from one chessman to another absolutely bigger (you can assume start-point is a minimum and end-point is a maximum.). And all players cannot go backwards. One jumping can go from a chessman to next, also can go across many chessmen, and even you can straightly get to end-point from start-point. Of course you get zero point in this situation. A player is a winner if and only if he can get a bigger score according to his jumping solution. Note that your score comes from the sum of value on the chessmen in you jumping path.
Your task is to output the maximum value according to the given chessmen list.


 

Input
Input contains multiple test cases. Each test case is described in a line as follow:
N value_1 value_2 …value_N
It is guarantied that N is not more than 1000 and all value_i are in the range of 32-int.
A test case starting with 0 terminates the input and this test case is not to be processed.


 

Output
For each case, print the maximum according to rules, and one line one case.


 

Sample Input
3 1 3 2 4 1 2 3 4 4 3 3 2 1 0


 

Sample Output
4 10 3


 

Author
lcy

 

思路:简单DP,每次扫描一遍前面若有比当前大的就更新。答案是所有里面的最大的那个。

       sum[i]包含第i个的前i个最大和

 

#include<iostream>
#include<cstring>
using namespace std;
const int mm=10010;
long long dp[mm];
long long sum[mm];
int main()
{
  int m;
  while(cin>>m)
  {
    if(m==0)break;
    long long ans,step;
    memset(sum,0,sizeof(sum));
    cin>>dp[0];
    sum[0]=dp[0];ans=dp[0];
    for(int i=1;i<m;i++)
    {
      cin>>dp[i];
      for(int j=0;j<i;j++)
        if(dp[i]>dp[j]&&sum[i]<dp[i]+sum[j])sum[i]=dp[i]+sum[j];
        if(!sum[i])
        sum[i]=dp[i];
        if(sum[i]>ans)ans=sum[i];
    }
    cout<<ans<<"\n";
  }
}


 

 

组态王通过以太网与西门子S7-200 SMART PLC通讯案例详解 通过以上步骤,我们成功实现了组态王与西门子S7-200 SMART PLC的以太网通讯。这一技术不仅提高了工业自动化系统的灵活性和可靠性,还为初学者提供了一个实用的学习案例。希望本文能帮助您快速掌握组态王与西门子S7-200 SMART PLC的通讯技术。如有任何疑问,欢迎留言讨论! 阅读详情

相关推荐

无线网卡选购指南:哪些型号支持Kali Linux的监听模式?附免驱动网卡推荐

本文详细解析了如何在Kali Linux下选购支持监听模式的无线网卡。核心在于选择兼容的芯片组,如Atheros AR9271和Ralink RT3070等经典型号,并提供了免驱动网卡推荐与实战配置指南,帮助安全研究人员和爱好者快速搭建无线测试环境。

wind6的博客 1590

hdu1087 - Super Jumping! Jumping! Jumping! (dp 求递增子序列的最大和)

Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20915    Accepted Submission(s): 9133 Problem Descripti

ITCTO-疯男的CSDN博客 564

信贷风控实战指南:Vintage分析表从数据建模到风险洞察

本文是一份信贷风控实战指南,详细阐述了Vintage分析从数据建模到风险洞察的全流程。文章深入解析了Vintage分析作为信贷资产“体检报告”的核心价值,并提供了从借据表与还款计划表设计、账龄计算、逾期口径判定到风险暴露计算与最终可视化透视的完整SQL实现方案,旨在帮助风控从业者构建精准的风险监控体系。

nft7creator的博客 335

HDUOJ 1087 Super Jumping! Jumping! Jumping!

HDUOJ 1087 Super Jumping! Jumping! Jumping! 题目链接 Problem Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.

旺崽的博客 2690

从零构建机械臂规划栈:Pinocchio、OMPL与Ruckig的工程化融合实践

本文详细介绍了如何从零构建机械臂规划栈,通过融合Pinocchio、OMPL和Ruckig三大核心组件,实现高性能的机械臂运动规划与轨迹生成。文章深入探讨了技术选型、工程架构设计及实战优化技巧,特别针对逆解、路径规划和轨迹平滑等关键环节提供了实用解决方案,适用于工业场景中的高实时性需求。

weixin_29072299的博客 439

Pixel 6 Pro升级Android 13变砖急救指南:Fastboot全分区修复实战

本文提供Pixel 6 Pro升级Android 13变砖后的Fastboot全分区修复实战指南,详细解析变砖原因、必备工具准备、Fastboot模式解锁、全分区擦除操作及手动刷入官方ROM的完整流程,帮助用户高效解决设备变砖问题。

weixin_28693447的博客 495

hdu-1087 Super Jumping! Jumping! Jumping!(DP解法)

hdu-1087 Super Jumping! Jumping! Jumping!(DP解法)题目描述 Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 35239

oYinGui1 838

C++跨平台Word文档处理库DuckX实战指南:从原理到项目集成

在C++开发中,处理Office文档,尤其是Word文件,常因缺乏原生易用的库而面临挑战。Office Open XML(OOXML)作为.docx文件的基础标准,其本质是包含XML文件的ZIP压缩包。理解这一原理,开发者便能通过解析和操作XML来实现文档的读写。DuckX库正是基于此,为C++提供了轻量级的解决方案。它封装了底层的ZIP处理和XML解析,提供了简洁的面向对象API,其技术价值在于实现了跨平台、无外部依赖的Word文档自动化生成与处理。这尤其适用于服务器端、嵌入式环境或需要脱离Office软

weixin_33508411的博客 397

hdu1087Super Jumping! Jumping! Jumping!(最大递增序列和)

题意:棋牌游戏如今,一种被称为“超级跳!跳!跳!“HDU是非常流行的。也许你是个好孩子,这个游戏知之甚少,所以我介绍给你吧。 可以玩游戏由两个或两个以上的球员 ​​。它由一个棋盘(棋盘)和一些棋子(棋子),所有的棋子标记的正整数或“开始”或“结束”。玩家从起始点和终点终于跳进。在跳跃的过程中,玩家将访问路径中的棋子,但每个人都必须从一个棋子跳跃到另一个绝对更大(可以假定启动点

陌上花开 1143

SAP Single Sign-On 全景指南:从传统 SAP SSO 到 SAP Secure Login Service for SAP GUI 的架构、场景与迁移实践

本文系统梳理了SAP生态下的单点登录技术方案,重点分析了SAP GUI的云化替代方案SAP Secure Login Service(SLS)。内容涵盖SNC、Kerberos/SPNEGO、SAML 2.0等核心协议的技术实现,对比了传统SAP SSO与新型SLS for SAP GUI的架构差异,并给出AS ABAP系统的具体实施路径。针对SAP GUI访问、浏览器访问Fiori/移动端等不同场景,提供了详细的协议选型建议和配置指南,帮助团队构建安全可靠且适应云时代的统一认证体系。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 282

软考高级-系统架构设计师 知识点整理 (一篇就够了 建议收藏)

软考高级-系统架构设计师知识点整理---十万字总结,助你通过高级

片言可决讼,半纸能缚龙 7397

HDU 1087 - Super Jumping! Jumping! Jumping!

题目链接:HDU - 1087 Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) ...

Ripcord丶的博客 189

2026.4.15:超详细自动安装Ubuntu-Server的保姆级教程

这篇教程详细介绍了如何创建无人值守的Ubuntu Server 26.04自动安装镜像。主要内容包括:从安装镜像中提取autoinstall-user-data文件并修改为user-data配置文件;使用mkpasswd生成加密密码;通过软碟通工具修改ISO镜像,添加自动安装所需的user-data和meta-data文件;编辑grub.cfg引导文件以启用自动安装模式。教程提供了完整的yaml配置示例,包含网络、存储、用户等设置,并演示了最终制作完成的自动安装镜像效果。

拥抱具身智能,昇腾Ascend C 793

杭电 1087 hdu (Dynamic Programming)Super Jumping! Jumping! Jumping!

杭电 1087 hdu (Dynamic Programming) Super Jumping! Jumping! Jumping! *Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 66856 Accepted Submission(s): 31301* Problem Description Nowadays, a kind of chess g

邓汪涛的博客 256

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

[LIS_最长递增子序列]-hdu 1087 Super Jumping!

[LIS_最长递增子序列]-hdu 1087 Super Jumping!

allen_li123的博客 410

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

HDU 1087 Super Jumping! Jumping! Jumping!(DP,最大递增子序列和)

Problem Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you...

AAS48的博客 516

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

HDU——1087 Super Jumping!Jumping!Jumping!(dp 递增子序列最大和)

Problem Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to yo...

LightOn 503

hdu1087 Super Jumping! Jumping! Jumping!(最大上升子序列的和)

Problem Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it t...

一身清贫怎敢入繁华 530

HDU1087:Super Jumping! Jumping! Jumping!(上升子序列最大和)

HDU1087:Super Jumping! Jumping! Jumping! kuangbin专题十二:E题 Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 41625Accepted Submission(s):...

aboc43983的博客 154

HDU1087:Super Jumping! Jumping! Jumping!(DP)

Problem Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to yo

ACM!荣耀之路! 7068

HDU 1087 Super Jumping! Jumping! Jumping! 【DP】

题目来源:http://acm.hdu.edu.cn/showproblem.php?pid=1087 ★题目不难,但是菜鸡走向不菜的必写之题qwq 翻译: 翻译来自 kuangbin的基础DP训练 ,不知道是谁翻译的awa 翻译的貌似不是原题,大巨巨们的脑洞太大 ,编了个故事。8说了,敲就完事了~ 思路: 这题不需要多说叭,就是求递增子序列的最大和,dp解决 动态转移方程:dp[i]=ma...

HungTeen的博客 262

hdu 1087 Super Jumping! Jumping! Jumping! 最大上升子序列。模板题

Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. The game can be played by two or more than two players. It consists of

Lionel 2070

HDOJ_1087_Super Jumping! Jumping! Jumping! 【DP】

HDOJ_1087_Super Jumping! Jumping! Jumping! 【DP】 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 44670 Accepted Submi...

dianxi0949的博客 124

最长上升子序列问题HDU1087Super Jumping! Jumping! Jumping!

Problem Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to yo

余人未至 268

HDU 1087 Super Jumping! Jumping! Jumping! (最长上升子序列求和)【最长序列求和类模板】

Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.

风的记忆 416

Hdu 1087 Super Jumping! Jumping! Jumping!

Hdu 1087 Super Jumping! Jumping! Jumping! 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087 解题思路:用dp数组记录到i位的最长上升序列的和,每一步往前找前置最大的符合题意的结果,转移方程dp[i]=max(dp[i],dp[j]+num[i]); 代码如下: #include <bits/st...

weixin_43823753的博客 175
上一篇: hdu 1024 Max Sum Plus Plus(DP最大字段和)
下一篇: CF-13C. Sequence(DP)
剑不飞
博客等级 码龄15年 86粉丝 505原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址