博客
关于我
玲珑学院-ACM比赛1014 - Absolute Defeat
阅读量:430 次
发布时间:2019-03-06

本文共 1423 字,大约阅读时间需要 4 分钟。

1014 - Absolute Defeat

Time Limit:2s Memory Limit:64MByte

Submissions:257Solved:73

DESCRIPTION
Eric has an array of integers
a1,a2,...,ana1,a2,...,an. Every time, he can choose a contiguous subsequence of length
kk and increase every integer in the contiguous subsequence by
11.He wants the minimum value of the array is at least
mm. Help him find the minimum number of operations needed.
INPUT
There are multiple test cases. The first line of input contains an integer
TT, indicating the number of test cases. For each test case:The first line contains three integers
nn,
mm and
kk
(1n105,1kn,1m104)(1≤n≤105,1≤k≤n,1≤m≤104).The second line contains
nn integers
a1,a2,...,ana1,a2,...,an
(1ai104)(1≤ai≤104).
OUTPUT
For each test case, output an integer denoting the minimum number of operations needed.
SAMPLE INPUT
32 2 21 15 1 41 2 3 4 54 10 31 2 3 4
SAMPLE OUTPUT

1015

源代码:

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;typedef long long ll;int ans[200005];int main(){ int t; int n,m,k; int temp; ll sum; scanf("%d",&t); while(t--) { scanf("%d%d%d",&n,&m,&k); sum = 0; memset(ans,0x3f3f3f3f,sizeof(ans)); for(int i = 0; i < n; i++) scanf("%d",&ans[i]); for(int i = 0; i < n; i++) { if(ans[i]

转载地址:http://txjyz.baihongyu.com/

你可能感兴趣的文章
10-docker系列-docker文件共享和特权模式
查看>>
#C2#S2.2~S2.3# 加入 factory/objection/virtual interface 机制
查看>>
#C8# UVM中的factory机制 #S8.1.1# OOP 语言三大特性 systemverilog的支持
查看>>
#C8# UVM中的factory机制 #S8.1.4# 约束的重载
查看>>
#C8# UVM中的factory机制 #S8.2.3# 重载sequence哪些情形
查看>>
#C8# UVM中的factory机制 #S8.4.1# factory机制的实现
查看>>
#C8# UVM中的factory机制 #S8.5# 对factory机制的重载进一步思考
查看>>
.exe已停止工作_windows资源管理器已停止工作怎么解决
查看>>
900行c语言贪吃蛇,原生js实现的贪吃蛇网页版游戏完整实例
查看>>
ado读取多条oracle数据,Oracle ADO数据存取
查看>>
anaconda新建python2环境安装不了jupyterlab_anaconda3安装及jupyter环境配置教程(全)...
查看>>
android fastjson漏洞_初识Fastjson漏洞(环境搭建及漏洞复现)
查看>>
android进程管理策略,Android进程保活
查看>>
asp.mvc 4项目发布文件目录结构_如何用SpringBoot(2.3.3版本)快速搭建一个项目?文末有小彩蛋...
查看>>
aspen串联反应怎么输入_如何进步提升串联谐振试验装置的稳定性
查看>>
a推b等价于非a或b_AB胶/蜜月胶常见问题的原因分析及解决方法
查看>>
bat 命令返回结果_【批处理】带你入门命令行
查看>>
c++ string取子串_Integer与String的设计哲学
查看>>
c++ 数组批量赋值_数组之间不能赋值?穿个马甲吧!
查看>>
cad模糊查询符号_mysql 正则模式和like模糊查询
查看>>