cf965d Single-use Stones
#include <iostream>
#include <cstdio>
using namespace std;
int a[100005], n, l, ans=0x3f3f3f3f;
int main(){
cin>>n>>l;
for(int i=1; i<n; i++){
scanf("%d", &a[i]);
a[i] += a[i-1];
}
for(int i=l; i<n; i++)
ans = min(ans, a[i]-a[i-l]);
cout<<ans<<endl;
return 0;
}
cf965d Single-use Stones的更多相关文章
- 「口胡题解」「CF965D」Single-use Stones
目录 题目 口胡题解 题目 有许多的青蛙要过河,可惜的是,青蛙根本跳不过河,他们最远只能跳 \(L\) 单位长度,而河宽 \(W\) 单位长度. 在河面上有一些石头,距离 \(i\) 远的地方有 \( ...
- EM_LGH CF965D Single-use Stones 思维_推理
Code: #include<cstdio> #include<algorithm> using namespace std; const int maxn = 1000000 ...
- codechef Jewels and Stones 题解
Soma is a fashionable girl. She absolutely loves shiny stones that she can put on as jewellery acces ...
- HOJ 2156 &POJ 2978 Colored stones(线性动规)
Colored stones Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1759 Accepted: 829 Descrip ...
- Codeforces 768 E. Game of Stones 博弈DP
E. Game of Stones Sam has been teaching Jon the Game of Stones to sharpen his mind and help him de ...
- Yin and Yang Stones(思路题)
Problem Description: A mysterious circular arrangement of black stones and white stones has appeared ...
- C - Stones on the Table
Problem description There are n stones on the table in a row, each of them can be red, green or blue ...
- linux-关机出现Telling INIT to go to single user mode.无法关机
运行/sbin/shutdown now最后显示:Telling INIT to go to single user mode.INIT:Going single userINIT:Sending g ...
- [LeetCode] Single Number III 单独的数字之三
Given an array of numbers nums, in which exactly two elements appear only once and all the other ele ...
随机推荐
- https 双向验证
服务器配置 服务器秘钥 服务器公钥证书 ,客户端公钥证书 客户端配置 客户端秘钥+密码 服务器公钥证书 目前android验证ok,pc浏览器添加客户端秘钥证书 ,访问还是失败,待继续查找资 ...
- 【MFC】获取文件大小的方法
[转载]原文地址:http://blog.csdn.net/coderwu/article/details/5652056 MFC 下可以通过 CFileStatus 获取文件大小. ULONGLON ...
- Qt安装教程
一.Qt下载 官网下载链接http://download.qt.io/archive/qt/,下载最新版 5.10 官网的下载网站有的时候可能会抽风,也可以选择国内的镜像下载源http://mirro ...
- Python3基础12(collections、struct、itertools、chardet等的使用)
import struct import base64import itertoolsimport chardet from collections import namedtuple,default ...
- NopCommerce 3.80框架研究(二) MVC 表示层与数据验证
表示层框架结构 /Views/Shared/_Root.Head.cshtml /Views/Shared/_Root.cshtml /Views/Shared/_ColumnsOne.cshtml ...
- java Vamei快速教程10 接口的继承和抽象类
作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 在实施接口中,我们利用interface语法,将interface从类定义中独立出 ...
- JavaScript and Ruby in ABAP
Netweaver里有个mini JavaScript engine CL_JAVA_SCRIPT, 对于Js code的编译和执行都是用system call完成. 只能当玩具用:report SJ ...
- SwiftHN阅读器应用IOS源码
SwiftHN是用Swift语言编写的Hacker News阅读器,同时采用了iOS 8最新的API. <ignore_js_op> <ignore_js_op> 详细说明:h ...
- IOS UIView动画(封装动画)
● UIKit直接将动画集成到UIView类中,当内部的一些属性发生改变时,UIView 将为这些改变提供动画支持 ● 执行动画所需要的工作由UIView类自动完成,但仍要在希望执行动画时通知视 图, ...
- Selenium关闭windows系统弹窗
Selenium关闭windows系统弹窗 背景:在使用某业务时,会弹出windows框 提示要打印某个文本,效果如下,而正常脚本执行完了后,关闭了driver,windows的弹框还是不会消失,这时 ...