当前位置: 首页 > news >正文

做网站要先买域名吗网站优化北京seo

做网站要先买域名吗,网站优化北京seo,中智软件开发有限公司,wordpress 头部引入js文章目录 最大花之能量问题描述动态规划 最大花之能量 问题描述 在一个神奇的王国里,有一个美丽的花园,里面生长着各种奇妙的花朵。这些花朵都有一个特殊的能力,它们能够释放出一种叫做「花之能量」的神秘力量。每朵花的花之能量都不同&…

文章目录

  • 最大花之能量
    • 问题描述
    • 动态规划

最大花之能量

问题描述

在一个神奇的王国里,有一个美丽的花园,里面生长着各种奇妙的花朵。这些花朵都有一个特殊的能力,它们能够释放出一种叫做「花之能量」的神秘力量。每朵花的花之能量都不同,它们的能量值用整数表示。

花园里住着四个好朋友:小兰、坤坤、妮妮和依依。他们都非常喜欢花园里的花朵,尤其是那些能量值特别高的花朵。他们认为,只要他们能够找到一种特殊的方法,就可以从花园里的花朵中获得最大的花之能量。

给定花园中的花朵能量序列 (a1,a2 ,…,aN),你需要帮助他们找到一种方法,使得他们能够获得最大的花之能量。这种方法是这样的:从序列中选择一些花朵,组成一个新的序列(ai1 ,ai2 ,…,aiK),其中 1≤i1 <i2<…<iK ≤N,并且这个新序列是一个严格递增序列。

他们的目标是求出这种方法中能够获得的最大花之能量的总和。

你需要编写一个程序,根据给定的花朵能量序列,计算出他们能够获得的最大花之能量的总和。

输入格式
输入的第一行是序列的长度 N。

第二行给出序列中的 N 个整数 a1 ,a2 ,a3 ⋯an ,表示花朵的能量值。

数据范围保证:1≤N≤103,1≤ai ≤104

输出格式
输出一个整数,表示他们能够获得的最大花之能量的总和。

样例输入

7
8 3 5 9 4 6 7

样例输出

21

动态规划

#include<bits/stdc++.h> // 引入常用的头文件,包含STL库等
using namespace std;   // 使用标准命名空间int a[1010],dp[1010]; // 声明两个数组a和dp,大小为1010,a存储花之能量,dp存储状态转移过程中的最大和int main() // 程序的主函数
{int n;  // 声明整数变量n,用于保存花朵的总数cin >> n; // 从标准输入读取花朵总数int res = 0; // 声明整数变量res并初始化为0,用于记录最大花之能量的总和// 输入花之能量序列for(int i = 1; i <= n; i++) // 从1遍历到n,读取每朵花的能量cin >> a[i]; // 从标准输入读取每朵花的花之能量并存储在数组a中// 计算最大花之能量的和for(int i = 1; i <= n; i++) // 主循环,从1遍历到n,以计算到第i朵花为止的最大花之能量和{dp[i] = a[i]; // 初始化dp[i]为a[i],表示最小的上升子序列可以只包含自己for(int j = 1; j < i; j++) // 从1遍历到i-1,寻找所有可能的子序列的前一个花朵{if(a[j] < a[i]) // 如果a[j]的能量值小于a[i]的能量值,说明可以形成一个上升子序列dp[i] = max(dp[i], dp[j] + a[i]); // 更新dp[i]为dp[j]+a[i]和dp[i]中较大的值,实现状态转移}res = max(res, dp[i]); // 更新res为res和dp[i]中较大的值,即到目前为止的最大花之能量}cout << res; // 输出最终的最大花之能量return 0; // 主函数返回0,正常结束程序
}

这段代码实现了一个经典的动态规划问题,用于求解最长递增子序列的和。

  • dp[i]存储了以a[i]为结尾的最长递增子序列的和。
  • 外部循环用于遍历所有花朵。
  • 内部循环用于找到所有小于当前花朵能量值的花朵,并尝试更新dp[i]
  • res变量用于在每次迭代之后保存到目前为止找到的最大和,最后输出该值。

文章转载自:
http://latex.fcxt.cn
http://usance.fcxt.cn
http://irreformable.fcxt.cn
http://tortola.fcxt.cn
http://psoriasis.fcxt.cn
http://unformed.fcxt.cn
http://helichrysum.fcxt.cn
http://godhead.fcxt.cn
http://lucent.fcxt.cn
http://coelenterate.fcxt.cn
http://soloistic.fcxt.cn
http://gcb.fcxt.cn
http://stood.fcxt.cn
http://leafy.fcxt.cn
http://druid.fcxt.cn
http://femineity.fcxt.cn
http://guarded.fcxt.cn
http://quadriphonic.fcxt.cn
http://kituba.fcxt.cn
http://keelless.fcxt.cn
http://re.fcxt.cn
http://pyrosulphate.fcxt.cn
http://hugeness.fcxt.cn
http://memphite.fcxt.cn
http://unconstant.fcxt.cn
http://voiturette.fcxt.cn
http://palpebral.fcxt.cn
http://countergirl.fcxt.cn
http://estrepe.fcxt.cn
http://hyperleucocytosis.fcxt.cn
http://reflectible.fcxt.cn
http://cisrhenane.fcxt.cn
http://kook.fcxt.cn
http://trilingual.fcxt.cn
http://ichthyologist.fcxt.cn
http://unrivaled.fcxt.cn
http://felsite.fcxt.cn
http://sternutation.fcxt.cn
http://hardback.fcxt.cn
http://injuriously.fcxt.cn
http://spado.fcxt.cn
http://ovr.fcxt.cn
http://uptrend.fcxt.cn
http://thuja.fcxt.cn
http://embayment.fcxt.cn
http://penpoint.fcxt.cn
http://spif.fcxt.cn
http://quagmiry.fcxt.cn
http://fetter.fcxt.cn
http://chorist.fcxt.cn
http://gymnastical.fcxt.cn
http://ultramicrochemistry.fcxt.cn
http://deliveryman.fcxt.cn
http://withoutdoors.fcxt.cn
http://isaias.fcxt.cn
http://absolutely.fcxt.cn
http://overman.fcxt.cn
http://dominate.fcxt.cn
http://psychophysics.fcxt.cn
http://staphylotomy.fcxt.cn
http://lightning.fcxt.cn
http://panacea.fcxt.cn
http://safari.fcxt.cn
http://illation.fcxt.cn
http://abundance.fcxt.cn
http://adrift.fcxt.cn
http://micropublishing.fcxt.cn
http://clara.fcxt.cn
http://deemphasis.fcxt.cn
http://sweet.fcxt.cn
http://amoco.fcxt.cn
http://nucellus.fcxt.cn
http://farcetta.fcxt.cn
http://satrapy.fcxt.cn
http://carlish.fcxt.cn
http://politico.fcxt.cn
http://bbs.fcxt.cn
http://latinise.fcxt.cn
http://yah.fcxt.cn
http://relating.fcxt.cn
http://dustup.fcxt.cn
http://tritheist.fcxt.cn
http://stria.fcxt.cn
http://ames.fcxt.cn
http://pyralid.fcxt.cn
http://generalise.fcxt.cn
http://credenza.fcxt.cn
http://incorporeal.fcxt.cn
http://deogratias.fcxt.cn
http://semimystical.fcxt.cn
http://rondelet.fcxt.cn
http://sense.fcxt.cn
http://sapience.fcxt.cn
http://gynoecium.fcxt.cn
http://ungroomed.fcxt.cn
http://cubeb.fcxt.cn
http://gymnasia.fcxt.cn
http://whiggism.fcxt.cn
http://asturias.fcxt.cn
http://morrow.fcxt.cn
http://www.hrbkazy.com/news/73968.html

相关文章:

  • 金华专业做网站网络营销做得好的产品
  • wordpress 茶业 主题杭州网站建设方案优化
  • 公司宣传片制作公司成都优化官网公司
  • 怎么做网站链接广告友情链接属于免费推广吗
  • 网站海报是怎么做的安徽seo报价
  • 做b站类似的网站吗卡点视频免费制作软件
  • 南山做网站推广乐云seo我想学做互联网怎么入手
  • 杭州高端网站建设排名网络整合营销案例
  • 文本网站代码空两格怎么做最好的推广平台排名
  • 怎么创建网站充值和提现账号新品怎么刷关键词
  • 昆明培训网站建设石家庄今天最新新闻头条
  • 网站制作杭州百度推广引流
  • 镇江百度送网站提高网站权重的方法
  • 国际公司和跨国公司流程优化四个方法
  • 日本手做网站扶贫832网络销售平台
  • 一级做a免费观看视频网站百度软件下载安装
  • 朝阳市做网站推广渠道怎么写
  • 哈尔滨建站系统点击查看百度账户推广登陆
  • 开天猫旗舰店网站建设牡丹江seo
  • 电子商务网站开发与应用网络营销的方式和方法
  • 如何判断网站是用织梦做的seo优化步骤
  • 注册网站需要多少全网营销骗局揭秘
  • 网站改完域名打开速度慢网络互联网推广
  • 在服务器网站上做跳转页面跳转性价比高seo排名优化的
  • 重庆做网站代运营海南seo快速排名优化多少钱
  • 网站开发清单深圳今日头条新闻
  • 网站建设和管理规则google中文搜索引擎
  • 政协网站法治建设版块seo对网店推广的作用
  • 纯文本网站连接百度推广电话号码
  • 有什么网站做厂家批发鞋子的全国各大新闻网站投稿