酷代码 AI
菜单

翻译

题目描述 Recently, there have been $n$ annoying things, and each thing has a positive integer pain - inflicting value (since the person has extremely poor psychological endurance). God of Love and Sorrow wants to know what the minimum sum of the pain - inflicting values of $m$ consecutive things is. However, due to his busy schedule, God of Love and Sorrow has to ask you to write a program to tell him. 输入格式 The first line contains two integers separated by a space, representing $n$ and $m$ respectively. From the second line to the $(n + 1)$ - th line, there is an integer in each line. The integer $a_i$ in the $(i + 1)$ - th line represents the pain - inflicting value $a_i$ of the $i$ - th thing. 输出格式 Output a single integer on one line, representing the minimum sum of the pain - inflicting values of $m$ consecutive things. 输入输出样例 输入 #1 复制 ``` 8 3 1 4 7 3 1 2 4 3 ``` 输出 #1 复制 ``` 6 ``` 说明/提示 数据规模与约定 - For 30% of the data, it is guaranteed that $n\leq20$. - For 60% of the data, it is guaranteed that $n\leq100$. - For 90% of the data, it is guaranteed that $n\leq10^3$. - For 100% of the data, it is guaranteed that $0\leq m\leq n\leq3\times10^3$ and $1\leq a_i\leq100$. [2025-11-24 19:53:30 | AI问答 | 386点数解答]

服务商
相关提问
发财导航,免费问AI
实用工具查看更多