C. Basketball Exercise:题目

经典简单dp,考虑前两天的就行
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> a((int)6e5);
vector<int> b((int)6e5);
ll dp[(int)5e5][3];
int main()
{int n;cin>>n;for (int i=2;i<=n+1;i++) cin>>a[i];for (int i=2;i<=n+1;i++) cin>>b[i];for (int i=2;i<=n+1;i++){dp[i][1] = max(dp[i-1][2],dp[i-2][2])+a[i];dp[i][2] = max(dp[i-1][1],dp[i-2][1])+b[i];}cout<<max(dp[n+1][1],dp[n+1][2])<<endl;
}

1195C. Basketball Exercise相关推荐

  1. Basketball Exercise CodeForces - 1195C(动态规划dp)

    Finally, a basketball court has been opened in SIS, so Demid has decided to hold a basketball exerci ...

  2. 【CF 1195】Basketball Exercise/Submarine in the Rybinsk Sea (hard edition)/OpenStreetMap+二维单调队列滑动窗口模板

    寡人认为C,E都是比较板的题 butD2也太ex了,大大是被那个mod精给弄疯了,我mod了那么多次还是炸了longlong orz 文章目录 二维单调队列模板 C:Basketball Exerci ...

  3. C. Basketball Exercise dp

    C. Basketball Exercise time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  4. 区别 eks_sport 和 exercise 有什么区别?看完你就清楚了!

    说到"运动"sport 这个单词应该是不少人看到"运动"的第一反应吧 sport /spɔ:t/ n.体育运动 例如:I'd say football is m ...

  5. 【DeepLearning】Exercise:Sparse Autoencoder

    Exercise:Sparse Autoencoder 习题的链接:Exercise:Sparse Autoencoder 注意点: 1.训练样本像素值需要归一化. 因为输出层的激活函数是logist ...

  6. (14)Why some people find exercise harder than others

    https://www.ted.com/talks/emily_balcetis_why_some_people_find_exercise_harder_than_others/transcript ...

  7. MIT 6.828 JOS学习笔记12 Exercise 1.9

    Lab 1中Exercise 9的解答报告 Exercise 1.9: 判断一下操作系统内核是从哪条指令开始初始化它的堆栈空间的,以及这个堆栈坐落在内存的哪个地方?内核是如何给它的堆栈保留一块内存空间 ...

  8. Exercise: Logistic Regression and Newton's Method

     Exercise: Logistic Regression and Newton's Method 题目地址: Exercise: Logistic Regression 题目概要:某个高中有8 ...

  9. Exercise: Linear Regression

     Exercise: Linear Regression 题目地址: http://openclassroom.stanford.edu/MainFolder/DocumentPage.php?c ...

最新文章

  1. Android笔记三十三.BroadcastReceiver使用
  2. numpy python2_python-numpy(2)
  3. Linux 创建指定大小空文件
  4. 洛谷 P2389 电脑班的裁员 解题报告
  5. dubbo全局异常处理_基于spring aop的dubbo异常统一处理
  6. php mvc 逻辑层在哪,mvc的业务逻辑应该放哪里?
  7. Scrapy操作浏览器获取网易新闻数据
  8. linux的用户及权限管理,Linux 用户及权限管理.doc
  9. Perl 连接Oracle 出现OCI missing的问题及解决
  10. pandas 处理 csv
  11. 四大猛壳之一的VMProtect轻松保护你的程序
  12. L298N电机驱动模块的简单介绍
  13. CardView完全解析和使用
  14. 初学者使用HTML简单做一个自我介绍
  15. 2016-2017-2 《程序设计与数据结构》课程总结
  16. Ftp客户端-C#程序
  17. 特征工程——用转换器抽取特征
  18. 【Python爬虫案例学习4】Python 爬取meizitu
  19. Blender图解教程:高仿版超级马里奥(三)身体建模(5月7日更新 附模型下载)
  20. 2D制作动画软件:Cartoon Animato 支持win/mac 中文激活版

热门文章

  1. PPA格式Linux安装,Ubuntu12.04 用PPA安装fcitx和搜狗输入法附加组件Linux版
  2. 自研redis sdk支持自动dns切换(附源码)
  3. 多线程创建方式 线程池、Future和CompletableFuture
  4. oracle 数据更新
  5. FastDFS部署及测试
  6. android添加商品到购物车,Android使用动画动态添加商品进购物车
  7. Java拦截器,过滤器,监听器(三大器)对比
  8. 什么是框架?spring mvc框架
  9. php zip下载损坏,php – 从zip中提取时损坏图像
  10. UDP协议下的DatagramSocket和DatagramPacket