Nuclear Arms Race
来源:互联网 发布:海隆软件 编辑:程序博客网 时间:2024/04/29 13:53
Nuclear Arms Race
.
.
题意:有n,m,每一天你知道后m天的斜率,当天你所期望的斜率导出的直线不会低于后m天的任意一个值,问这m天的斜率
.
.
解法:水体,直接暴力n*m扫就好了
.
.
#include <iostream>using namespace std;int a[20000] = {0}, n, m, s, x;int ans[20000] = {0};int main() { cin >> n >> m; for (int i = 1; i < n+m; i++) cin >> a[i]; s = 0; x = 0; for (int i = 1; i <= n; i++) { int maxx = -200000; for (int j = i; j <= i+m-1; j++) { int t = (a[j]-s)/(j-x); if (t*(j-x) < a[j]-s) t++; if (t > maxx) maxx = t; } x = i; s = s+maxx; ans[i] = maxx; } for (int i = 1; i < n; i++) cout << ans[i] << " "; cout << ans[n] << endl;}
0 0
- Nuclear Arms Race
- URAL 1783 Nuclear Arms Race
- UN panel sets dates for ban on nuclear arms
- Race
- Codechef Nuclear Reactors 题解
- the nuclear norm
- UVAlive3532 Nuclear Plants
- [CF71E]Nuclear Fusion
- 1256: Nuclear Missile
- lightoj 1358 Fukushima Nuclear Blast
- 191. Greedy folks have long arms. 心贪手长
- race condition
- Race conditions
- CountDownLatch Race
- Street Race
- uva12034 race
- Bicycle Race
- Bicycle Race
- 定时器的时钟
- 解决Visual C++ Redistributable for Visual Studio 2015的安装问题
- linux下安装mysql
- gulp篇:速度上手,执行我们第一个任务
- 删除JAVA集合中元素的实现代码
- Nuclear Arms Race
- 数据结构实验之二叉树二:遍历二叉树
- TOJ 3982.Vacation
- JS中Attribute 和 property的区别
- JZOJ4683 矩阵
- 划分树
- 数据结构实验之二叉树的建立与遍历
- 3000门徒内部训练绝密视频(泄密版)第9课:彻底实战详解使用IntelliJ IDEA下的Spark程序开发
- ubuntu下搭建android开发环境(一)安装ubuntu系统(by 星空武哥)