[USACO03MAR] Best Cow Fences G

Luogu
IDLGP10450
Time1000ms
Memory512MB
DifficultyP3
动态规划 DP2003二分USACO单调队列前缀和
**原题来自:USACO 2003 Mar. Green** 给定一个长度为 $n$ 的非负整数序列 $A$ ,求一个平均数最大的,长度不小于 $L$ 的子段。 ## Input 第一行用空格分隔的两个整数 $n$ 和 $L$; 第二行为 $n$ 个用空格隔开的非负整数,表示 $A_i$。 ## Output 输出一个整数,表示这个平均数的 $1000$ 倍。不用四舍五入,直接输出。 [samples] ## Note $1 \leq n \leq 10^5,0 \leq A_i \leq 2000$。
Samples
Input #1
10 6
6 4 2 10 3 8 5 9 4 1
Output #1
6500
API Response (JSON)
{
  "problem": {
    "name": "[USACO03MAR] Best Cow Fences G",
    "description": {
      "content": "**原题来自:USACO 2003 Mar. Green** 给定一个长度为 $n$ 的非负整数序列 $A$ ,求一个平均数最大的,长度不小于 $L$ 的子段。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P3"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP10450"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "**原题来自:USACO 2003 Mar. Green**\n\n给定一个长度为 $n$ 的非负整数序列 $A$ ,求一个平均数最大的,长度不小于 $L$ 的子段。\n\n## Input\n\n第一行用空格分隔的两个整数 $n$ 和 $L$;\n\n第二行为 $n$ 个用空格隔开的非负整数,表示 $A_i$。\n\n## Output\n\n输出一个整数,表示这个平均数的 $1000$ 倍。不用四舍五入,直接输出。\n...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments