hdu1087 Super Jumping! Jumping! Jumping!

C#开发者必备:VSPD虚拟串口快速配置指南(附汉化教程) 本文为C#开发者提供了VSPD虚拟串口的快速配置与汉化教程。详细介绍了如何安装、汉化VSPD,并创建稳定的虚拟串口对,重点讲解了如何将其集成到C#开发工作流中,使用SerialPort类进行数据通信测试、协议模拟及故障排查,有效提升硬件通信开发的效率。 阅读详情

Super Jumping! Jumping! Jumping!


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




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


题目的大意是从起点开始跳,只能从小到大跳不能从大到小跳,也可以直接从起点跳到终点,并假设起点最小,终点最大,可以一次跳一步也可以一次跳任意多步,问途径的数组的最大和是多少,这个和最长上升子序列其实没什么本质区别,只不过最长上升子序列是求一个长度,也就是说cou = 0然后cou++这种模式,然而此题是把计数器变成sum求和而已


#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>

using namespace std;

int a[1005];
int dp[1005];  //dp用来存当前状态的最大和
int sizedp = sizeof(dp);

int main()
{
	int N;
	while (~scanf("%d", &N) && N) {
		for (int i = 0; i < N; i++) {
			scanf("%d", &a[i]);
		}
		int ans = 0;   //初始最大和为0
		memset(dp, 0, sizedp);
		for (int i = 0; i < N; i++) {
			int maxn = 0;
			for (int j = 0; j < i; j++) {   //找i之前的且比a[i]小的中dp的最大值(因为是上升子序列)
				if (a[j] < a[i]) {
					maxn = max(maxn, dp[j]);
				}
			}
			dp[i] = maxn + a[i];  //状态转移方程,当前最优解为上一个最优解加当前a[i]值
			ans = max(ans, dp[i]);  //ans要保留所有上升子序列和的最大值
		}
		printf("%d\n", ans);
	}
	return 0;
}


PCL基础:getTransformation函数全流程解析与应用实例,一篇文章精通点云变换 在 Eigen 和 PCL 中,getTransformation是一个常用的函数,用于根据输入的平移和旋转信息(如欧拉角或四元数)生成一个仿射变换矩阵(Eigen::Affine3f或 Eigen::Affine3d)。1)在 Eigen 中,可以通过四元数和平移向量构造一个变换矩阵。2)讲解了从四元数转换到欧拉角,或者从欧拉角转换到四元数的方法。 阅读详情

相关推荐

Windows 10/11蓝屏急救:SECURE_PCI_CONFIG_SPACE_ACCESS_VIOLATION报错全攻略(附安全模式+CMD修复)

本文针对Windows 10/11系统常见的SECURE_PCI_CONFIG_SPACE_ACCESS_VIOLATION蓝屏报错,提供了从诊断到修复的完整解决方案。文章深入剖析了该错误与系统安全功能“内存完整性”及pci.sys驱动的关系,并详细指导用户如何通过安全模式进行基础修复,以及使用命令提示符执行高级系统文件修复和注册表修改,帮助用户彻底解决蓝屏问题并恢复系统稳定。

echo99的专栏 994

hdu 1087 Super Jumping! Jumping! Jumping!(dp)

hdu 1087 Super Jumping! Jumping! Jumping! http://acm.hdu.edu.cn/showproblem.php?pid=1087 ProblemDescription Nowadays,akindofchessgamecalled“SuperJumping!Jumping!Jumping!”isv...

diansitao5461的博客 97

3.5.3以太网ETH TC8-PMA物理层测试

英文原版-OA_Automotive_Ethernet_ECU_TestSpecification_Layer_1_100BASE-T1_v3.0.pdf。PMA测试时各个测试项目所进入的测试模式不同,如TX_01对应测试模式1;TX_04对应测试模式5;例如:以上就是今天要讲的内容,本文仅仅简单介绍了pandas的使用,而pandas提供了大量能使我们快速便捷地处理数据的函数和方法。TX_07对应测试模式5;物理层测试主要分为两部分:IOP测试(包括链接时间,信号质量,线路诊断),PMA测试。

qq_28664971的博客 7733

HDU 【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 yo

进击的小白 208

5分钟搞懂MSDNet:用Transformer实现小样本语义分割的保姆级教程

本文详细介绍了MSDNet(Multi-Scale Decoder Network)如何利用Transformer架构实现小样本语义分割。通过多尺度解码器和空间Transformer解码器,MSDNet能够在仅有1-5张标注图像的情况下完成精确分割任务。文章提供了PyTorch代码实例和优化技巧,帮助开发者快速掌握这一前沿技术。

weixin_30832143的博客 514

autodl云服务器使用中的conda源报错

通过find path -name filename找到.condarc文件,在autodl服务器中,一般在/root/.condarc。为了利用jypyter打开conda虚拟环境运行,需要下载ipykenel。这个报错是源的问题,在通过源获取包元数据时出现了HTTP 429错误。通过conda换源解决。修改.condarc文件,命令: vim .condarc。但这样还不能解决问题,得把报错中有问题的源注释掉。通过以下命令添加清华镜像源。把报错的链接源注释如下。

Ty_kilig的博客 1600

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 c...

zamaochick的博客 396

Token 费用爆炸?教你用 Semantic Cache(语义缓存)把 API 成本降低 80%

本文介绍了语义缓存(Semantic Cache)技术在大模型应用中的关键作用。传统Redis缓存基于精确匹配,无法处理用户提问的语义相似性,导致重复调用昂贵的LLM API。语义缓存通过将问题向量化并在向量空间中进行相似度匹配,可识别30%-50%的重复提问,直接返回历史答案。文章详细解析了技术原理(Embedding+向量搜索)、架构设计,并提供了基于Python和ChromaDB的50行核心实现代码。同时指出了生产环境中的三大挑战:阈值设定、隐私保护和多轮对话处理,并给出相应解决方案。该技术能以极低成

BUG猿的博客 1059

HDU-1087 Super Jumping! Jumping! Jumping!

动态规划 HDU-1087 Super Jumping! Jumping! Jumping! 题目链接: 杭电1087 题目大意: 给定一列数字 求最大顺序子列和 子列中的数字必须严格由小到大 解题思路: 将数组储存 dp[i]储存以arr[i]为结尾的最大值 循环当前判断的前面的数字 如果当前的数字比之前的数字大 则进行dp的替换 方程为:dp[i] = max(dp[i], dp[j]...

鱼头的水题之路 301

Qt6.10 | Qt Bluetooth 蓝牙

本文介绍了QtBluetooth模块的功能和使用方法,包括蓝牙API概述、构建配置(CMake/qmake)、权限管理、平台支持(Linux/macOS特殊处理)、日志设置及许可信息。重点说明Linux平台的后端选择机制,以及macOS上的依赖限制。最后提及蓝牙聊天示例,展示RFCOMM协议通信的实现。全文提供了蓝牙开发的技术要点和注意事项。

Qt历险记,专注Qt技术,三年医疗设备研发经验,1年机器视觉研发经验,半年柔性传感研发经验。 415

QT编程之OSG

OSG(OpenSceneGraph)与Qt的集成为开发3D可视化应用提供了一个强大的平台。Qt提供了图形用户界面(GUI)工具,而OSG负责高效的3D渲染和场景管理。通过将OSG嵌入Qt应用程序中,开发者可以实现丰富的用户界面与复杂的3D渲染效果的结合。

深之JohnChen的专栏 1619

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

那些年我们create generate clock遇到的坑

想必大家对create_generate_clock这个命令熟悉的不能再熟悉了,然而,在真正做实际项目的时候,会出现各式各样的问题,比如在report timing时,generate clock路径不是我们预想的,source latency丢失等等,今天小编就跟大家重点聊聊source latency丢失的情况。clock时,首先我们要对一个项目的时钟结构要比较清晰,同时针对一些复杂的生成时钟,我们也要学会画波形图进行分析;接下来,我们就来看看哪些case会导致source latency丢失。

芯冰乐 147

HDU 1087 Super Jumping! Jumping! Jumping!

B - Super Jumping! Jumping! Jumping! Crawling in process... Crawling failed Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 10

Inite的博客 605

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

HDU 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 yo...

沧浪之水 491

jre9下载 jdk9

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

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. Th...

aisebu7819的博客 91

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

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 consis

QYQHxyh的博客 261

HDu1087 Super Jumping! Jumping! Jumping!

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087 分析:简单dp;dp[i] = max (dp[i], dp[j] + a[i]) 1 #include<iostream> 2 #include<sstream> 3 #include<cstdio> 4 #include&l...

weixin_30449453的博客 84

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 c...

GJLfly的博客 282

HDU1087 Super Jumping! Jumping!(dp)

HDU1087 Super Jumping! Jumping! (TEST<32> 11.25) 解题思路 dp就是求前面的每一个位置的最大值然后依次往后更新 太菜了 ,看着以前的模板才 AC出来… AC 代码如下 #include<iostream> #include<algorithm> #include<cstring> using names...

MaxVen 171

杭电 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

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): 35625    Accepted Submission(s): 16206 Problem Descri

Puya的博客 308

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

HDU Problem 1087Super Jumping! Jumping! Jumping!

Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 31007    Accepted Submission(s): 13894 Problem Descri

博客已搬迁到http://www.cnblogs.com/cniwoq/ 375

hdu 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 yo

要去相信,没有到不了的明天 593
上一篇: hdu1159 Common Subsequence
下一篇: poj1163 The Triangle
Daemoonn
博客等级 码龄11年 42粉丝 198原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址