当前位置:网站首页>(linear DP) acwing 898 Number triangle
(linear DP) acwing 898 Number triangle
2022-06-11 23:34:00 【Age worry】
898. Digital triangle
Topic link https://www.acwing.com/problem/content/900/
subject :

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int a[500][500];
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++)
scanf("%d",&a[i][j]);
}
for(int i=n-1;i>=1;i--){
for(int j=1;j<=i;j++){
a[n][j]=a[i][j]+max(a[n][j],a[n][j+1]);
}
}
cout<<a[n][1];
return 0;
}
边栏推荐
- Jetpack架构组件学习(3)——Activity Results API使用
- 栈(C语言)
- A new product with advanced product power, the new third generation Roewe rx5 blind subscription is opened
- [Day10 literature extensive reading] temporary cognition can affect spatial cognition more than vice versa: the effect of
- 思科私有动态路由协议:EIGRP
- Method for WiFi wireless transmission module to access cloud platform using esp8266 chip scheme
- MySQL 8.0 解压版安装教程
- Share a treasure website necessary for new media operation for free
- Figure overview of neural network
- Implementation scheme of iteration and combination pattern for general tree structure
猜你喜欢

Two ways of using reuqests in RF

How to make scripts executable anywhere

Wake up wrist - neural network and deep learning (tensorflow application) updating

Mysql5 and mysql8 are installed at the same time

Application of Lora wireless communication module Lora technology in smart home light control

Remix localization, loading local contract file, local link Remix

商品热销排行【项目 商城】

2022 high place installation, maintenance and removal of simulated examination platform for operation certificate examination question bank

Here we go! Dragon lizard community enters PKU classroom

sonarqube介绍和安装步骤
随机推荐
Jetpack架构组件学习(3)——Activity Results API使用
我的创作纪念日
解决IDEA下载插件慢的问题
2022 low voltage electrician certificate and online simulation examination
PHP mkdir(): Permission denied上传文件会把文件夹权限改为411权限
【Day2 文献精读】Time in the mind: Using space to think about time
CD流程
MySQL 8.0 解压版安装教程
Leetcode must review 20 lintcode (5466421166978227)
2022 safety officer-b certificate theoretical question bank and simulation test
Lake Shore VNF 系列低温恒温器系统——流动蒸汽中的样品
队列(C语言)
Discrete mathematics attention points, priority problems
oracle中dblink操作
A method of relay for ultra long distance wireless transmission of low power wireless module
JS common method collection
商品热销排行【项目 商城】
[C language] data type storage, original code, inverse code and complement code
一文读懂Logstash原理
Altium designer工程下多个原理图和PCB图的一一对应