题目传送门

回忆童年

 /*
ID: Starry21
LANG: C++
TASK: ariprog
*/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
#define N 1005
#define ll long long
#define INF 0x3f3f3f3f
int a[N][N],dp[N][N];
int n;
int main()
{
//freopen("ariprog.in","r",stdin);
//freopen("ariprog.out","w",stdout);
scanf("%d",&n);
for(int i=;i<=n;i++)
for(int j=;j<=i;j++)
{
scanf("%d",&a[i][j]);
dp[i][j]=a[i][j];
}
for(int i=n-;i>=;i--)
for(int j=;j<=i;j++)
dp[i][j]=max(dp[i+][j],dp[i+][j+])+a[i][j];
printf("%d\n",dp[][]);
return ;
}

Code

最新文章

  1. bzoj4555题解
  2. Java数据结构之表的增删对比---ArrayList与LinkedList之一
  3. QQ空间HD(3)-Modal的切换效果总结
  4. Android中的dispatchTouchEvent()、onInterceptTouchEvent()和onTouchEvent()
  5. Loadrunner中web_reg_save_param的使用详解
  6. 自制Chrome拓展
  7. 一步步优化JVM五:优化延迟或者响应时间(1)
  8. FreeBSD下查看各软件版本命令
  9. API 版本控制
  10. Android(java)学习笔记84:自定义异常类
  11. 24种设计模式--状态模式【State Pattern】
  12. APNs-远程推送
  13. hdoj 5137 How Many Maos Does the Guanxi Worth【最短路枚举+删边】
  14. js 模拟QQ聊天窗口图片播放效果(带滚轮缩放)
  15. [原译]在mongoose中对Array Schema进行增删改
  16. std::function 测试
  17. request参数集合绑定实体实现defaultmodebinder
  18. 理解angularJs中的$on,$broadcast,$emit
  19. js测试地址
  20. pypinyin, jieba分词与Gensim

热门文章

  1. 如何理解react中的super() super(props)
  2. buuctf@pwn1_sctf_2016
  3. Python&amp;R&amp;Matlab:批量生成变量
  4. SQLSERVER 连接常见问题
  5. QT:QSS完全无效的原因
  6. Spring后台,通过name取值
  7. Python初记
  8. POJ 2299 Ultra-QuickSort (树状数组 &amp;&amp; 离散化)
  9. Super Mario(主席树)
  10. php 将几个变量合为数组,变量名和值对应