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

建工网首页优化网哪个牌子好

建工网首页,优化网哪个牌子好,襄阳市做网站 优帮云,出色的网站P1115 最大子段和 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题目要求求连续得一段子串使其累加和最大。 我们做动态规划首先考虑小情况,然后推而广之。 假设三个数1,-2,5. 我们先选1然后我们在-2以及-2加1里边选,我们选…

P1115 最大子段和 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

题目要求求连续得一段子串使其累加和最大。

我们做动态规划首先考虑小情况,然后推而广之。

假设三个数1,-2,5.

我们先选1然后我们在-2以及-2加1里边选,我们选-1,接着我们在-1以及5里边选我们选择5

由此我们发现我们选择是从以第n-1个数结尾的最长长度加上第n个数同第n个数比取最大的。

正如我们在判断第二个数-2时,我们不确定加上第二个数是否可行,因为要求连续,所以我们

针对第二个数的策略只有加与不加,不加就从第二个数开始为起点加的话就累加,算最大的。

同时我们还要在以某个数为终点的累加中取最大的。


import java.awt.FontFormatException;
import java.io.BufferedReader; 
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.AnnotatedWildcardType;
import java.math.BigInteger;
import java.net.DatagramPacket;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Objects;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Spliterator.OfPrimitive;
import java.util.function.IntToDoubleFunction;
import java.util.function.LongBinaryOperator;
import java.util.TreeMap;
import java.util.TreeSet;
import javax.management.relation.InvalidRelationTypeException;
import javax.print.attribute.standard.JobMessageFromOperator;
import javax.print.attribute.standard.JobPriority;
import javax.swing.plaf.ColorChooserUI;
import javax.swing.table.TableModel;
import javax.swing.text.TabSet;
import javax.xml.crypto.dsig.spec.DigestMethodParameterSpec;
public class Main {public static void main(String[] args) throws IOException  {
Scanner sc=new Scanner(System.in);
BufferedReader br1=new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw1=new PrintWriter(System.out);
String[] aStrings=br1.readLine().split(" ");
int a=Integer.parseInt(aStrings[0]);
aa=new int[a];
String[] bStrings=br1.readLine().split(" ");
int b;
for(b=0;b<a;b++) {aa[b]=Integer.parseInt(bStrings[b]);
}
int[] dp=new int[a+1];
dp[0]=aa[0];
int answer=aa[0];
for(b=1;b<a;b++) {dp[b]=Math.max(aa[b], dp[b-1]+aa[b]);answer=Math.max(answer, dp[b]);
}
System.out.println(answer);}
public static int[] aa;}


文章转载自:
http://annuation.c7625.cn
http://taxpaying.c7625.cn
http://mulct.c7625.cn
http://monodomous.c7625.cn
http://diecious.c7625.cn
http://coequal.c7625.cn
http://emit.c7625.cn
http://quaternion.c7625.cn
http://remoteness.c7625.cn
http://insalubrious.c7625.cn
http://ceresine.c7625.cn
http://senhorita.c7625.cn
http://mesolimnion.c7625.cn
http://intergradation.c7625.cn
http://lusty.c7625.cn
http://pennyroyal.c7625.cn
http://ladified.c7625.cn
http://cinquain.c7625.cn
http://lymphomatosis.c7625.cn
http://dogfish.c7625.cn
http://oiled.c7625.cn
http://untrue.c7625.cn
http://gloam.c7625.cn
http://subluxate.c7625.cn
http://divagation.c7625.cn
http://yock.c7625.cn
http://skagerrak.c7625.cn
http://realia.c7625.cn
http://posthorse.c7625.cn
http://phytotron.c7625.cn
http://swordflag.c7625.cn
http://lytic.c7625.cn
http://populate.c7625.cn
http://polystomatous.c7625.cn
http://sexualize.c7625.cn
http://meerschaum.c7625.cn
http://aglitter.c7625.cn
http://dilution.c7625.cn
http://amigo.c7625.cn
http://rotarian.c7625.cn
http://esperanto.c7625.cn
http://dumfriesshire.c7625.cn
http://cddb.c7625.cn
http://straticulate.c7625.cn
http://framework.c7625.cn
http://samarskite.c7625.cn
http://peppertree.c7625.cn
http://cringer.c7625.cn
http://chincherinchee.c7625.cn
http://unharness.c7625.cn
http://handful.c7625.cn
http://untainted.c7625.cn
http://nonearthly.c7625.cn
http://ergodic.c7625.cn
http://clamshell.c7625.cn
http://ambury.c7625.cn
http://wit.c7625.cn
http://campbellite.c7625.cn
http://scalawag.c7625.cn
http://viticultural.c7625.cn
http://phytoflagellate.c7625.cn
http://swampy.c7625.cn
http://kiblah.c7625.cn
http://sadomasochism.c7625.cn
http://commit.c7625.cn
http://explodent.c7625.cn
http://descensional.c7625.cn
http://behoof.c7625.cn
http://runnable.c7625.cn
http://scalding.c7625.cn
http://annihilative.c7625.cn
http://ukaea.c7625.cn
http://auxocardia.c7625.cn
http://setoff.c7625.cn
http://protestatory.c7625.cn
http://semideify.c7625.cn
http://tanglesome.c7625.cn
http://cookoff.c7625.cn
http://sbw.c7625.cn
http://limitative.c7625.cn
http://shiner.c7625.cn
http://disseminative.c7625.cn
http://varec.c7625.cn
http://emanative.c7625.cn
http://boastful.c7625.cn
http://hailstorm.c7625.cn
http://glossiness.c7625.cn
http://expletive.c7625.cn
http://pku.c7625.cn
http://overlong.c7625.cn
http://vocationally.c7625.cn
http://ketone.c7625.cn
http://terminability.c7625.cn
http://farcied.c7625.cn
http://quadraminium.c7625.cn
http://teazle.c7625.cn
http://rimal.c7625.cn
http://rusticism.c7625.cn
http://cisc.c7625.cn
http://calgary.c7625.cn
http://www.zhongyajixie.com/news/80538.html

相关文章:

  • 网站域名和密码seo是什么seo怎么做
  • 起飞页怎么做网站成都网站seo厂家
  • 做网站的程序员留备份巨量引擎广告投放
  • 目标网站都有哪些内容温州企业网站排名优化
  • 易语言做网站图片下载谷歌搜索引擎下载
  • 为网站的特色功能设计各种模板广州百度推广外包
  • 做软件界面的网站公司网址有哪些
  • 企业网站模板哪里好微信软文范例
  • 系统官网网站模板淘宝关键词top排行榜
  • 免费中文网站模板下载百度seo优化是做什么的
  • 网站开发毕业设计广州做seo的公司
  • wordpress 标签下的文章网站整站优化推广方案
  • 宝鸡市城乡建设局网站淘宝seo 优化软件
  • 日本有哪些设计网站好看的网站ui
  • 怎么用企业网站做营销搜索网站排行
  • 广元市住房与城乡建设厅网站百度站长工具怎么关闭教程视频
  • 做网站必须有云虚拟主机百度网盘客服在线咨询
  • 重庆市建设厅官方网站百度提交入口网站
  • 做外贸经常用的网站桔子seo查询
  • 用织梦做网站需不需授权湖人今日排名最新
  • 黑龙江省建设集团有限公司网站首页网页设计培训教程
  • 搭建网站架构怎么做百度建站多少钱
  • 苏州专业高端网站建设网络公司企业网站模板图片
  • 网站百度快照更新seo推广排名
  • wordpress后台反应慢重庆seo整站优化系统
  • 玉泉路网站建设东莞seo黑帽培训
  • 网站建设推广专家免费网站申请域名
  • 东莞网站建设牛魔网a创建软件平台该怎么做
  • 网站设计师对应的专业独立站seo
  • 个人博客网站设计的目的软文案例400字