luogu1353 Running
dp[i][j]表示走i分钟疲劳值为j时的最远距离
然后搞一下就好啦
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <stack>
#define ll long long
#define inf (-1u>>1)
using namespace std;
inline int read()
{
int ans=,f=;
char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-f;ch=getchar();}
while(isdigit(ch)){ans=*ans+ch-'';ch=getchar();}
return ans*f;
}
int d[];
int f[][];
int main()
{
int n,m;
n=read();m=read();
for(int i=;i<=n;i++)d[i]=read();
for(int i=;i<=n;i++)
{
for(int j=;j<=m;j++)
{
if(j>)f[i][j]=max(f[i][j],f[i-][j-]+d[i]);
if(i>=j)
{
f[i][]=max(f[i-j][j],f[i][]);
f[i][]=max(f[i-][],f[i][]);
}
}
}
cout<<f[n][];
return ;
}
另:一天10000分钟 这牛怕是叫□-□
luogu1353 Running的更多相关文章
- Crystal Clear Applied: The Seven Properties of Running an Agile Project (转载)
作者Alistair Cockburn, Crystal Clear的7个成功要素,写得挺好. 敏捷方法的关注点,大家可以参考,太激动所以转载了. 原文:http://www.informit.com ...
- Running Dubbo On Spring Boot
Dubbo(http://dubbo.io/) 是阿里的开源的一款分布式服务框架.而Spring Boot则是Spring社区这两年致力于打造的简化Java配置的微服务框架. 利用他们各自优势,配置到 ...
- Android PopupWindow Dialog 关于 is your activity running 崩溃详解
Android PopupWindow Dialog 关于 is your activity running 崩溃详解 [TOC] 起因 对于 PopupWindow Dialog 需要 Activi ...
- IntelliJ运行下载的Servlet时报错 Error running Tomcat 8.5.8: Unable to open debugger port (127.0.0.1:49551): java.net.SocketException
学习Java Servlet时,从Wrox上下载了示例代码,准备run/debug时发现以下错误: Error running Tomcat 8.5.8: Unable to open debugge ...
- teamviewer "TeamViewer Daemon is not running
执行下面的命令问题解决: # teamviewer --daemon enable enable Sat Jan :: CST Action: Installing daemon () for 'up ...
- mysql 有报错 ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
sh-4.1# /etc/init.d/mysqld status ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql ...
- Errors occurred during the build. Errors running builder 'JavaScript Validator' on project
1.问题:Errors occurred during the build. Errors running builder 'JavaScript Validator' on project 2.解决 ...
- The network bridge on device VMnet0 is not running
The network bridge on device VMnet0 is not running. The virtual machine will not be able to communic ...
- ERROR! MySQL is running but PID file could not be found
/etc/init.d/mysql status提示ERROR! MySQL is running but PID file could not be found先打印MYSQL进程ps aux | ...
随机推荐
- 【转】AC神组合数取模大全
貌似少了几张图片,不过没有图片也没什么关系的感觉. 最后的究极篇也想出来了,但是貌似找不到题目,好尴尬.. 这个表示的是从n个元素中选取m个元素的方案数. (PS.组合数求模似乎只用在信息学竞赛和 A ...
- javascript修改图片链接地址
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> < ...
- eclipse里面用svn关联项目
eclipse里面共享项目经常会用到svn或者git插件 关联项目的步骤如下: 如果 点击finish会遇到卡住问题的话,不要着急,我们需要设置svn的client设置: 如果设置了之后还是很卡的话, ...
- 【python】-- 协程介绍及基本示例、协程遇到IO操作自动切换、协程(gevent)并发爬网页
协程介绍及基本示例 协程,又称微线程,纤程.英文名Coroutine.一句话说明什么是协程:协程是一种用户态的轻量级线程. 协程拥有自己的寄存器上下文和栈.协程调度切换时,将寄存器上下文和栈保存到其他 ...
- springboot + swagger2 学习笔记
引入步骤 1.添加依赖 <dependency> <groupId>io.springfox</groupId> <artifactId>springf ...
- xcode6
官方的xcode6下载太慢,这里送上百度网盘地址: http://pan.baidu.com/s/1hqze1hi
- Apache Shiro 使用手册(五)Shiro 配置说明(转发:http://kdboy.iteye.com/blog/1169637)
Apache Shiro的配置主要分为四部分: 对象和属性的定义与配置 URL的过滤器配置 静态用户配置 静态角色配置 其中,由于用户.角色一般由后台进行操作的动态数据,因此Shiro配置一般仅包含前 ...
- 图片oom问题
1.什么是OOM? 程序申请内存过大,虚拟机无法满足我们,然后自杀了.这个现象通常出现在大图片的APP开发,或者需要用到很多图片的时候.通俗来讲就是我们的APP需要申请一块内存来存放图片的时候,系统认 ...
- 模仿jquery框架源码 -成熟---选择器
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8& ...
- Effective java -- 8 异常
第五十七条:只针对异常的情况才使用异常应该都有这个意识吧,就像什么抓索引越界什么的,没有必要. 第五十八条:对可恢复情况使用受检查异常,对编程错误使用运行时异常三种可抛的异常:受检的异常(checke ...