{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"给定一个大小为 \u003ci\u003en\u003c/i\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e 的数组。有一个大小为 \u003ci\u003ek\u003c/i\u003e 的滑动窗口从数组的最左边移动到最右边。你只能看到窗口中的 \u003ci\u003ek\u003c/i\u003e 个数字。每次滑动窗口向右移动一个位置。以下是一个示例:\u003cbr\u003e数组为 \u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e[1\u0026nbsp;3\u0026nbsp;-1\u0026nbsp;-3\u0026nbsp;5\u0026nbsp;3\u0026nbsp;6\u0026nbsp;7]\u003c/font\u003e,\u003ci\u003ek\u003c/i\u003e 为 3。\u003ctable frame\u003d\"BOX\" rules\u003d\"ALL\"\u003e\u003ctbody\u003e\u003ctr align\u003d\"CENTER\"\u003e\u003cth\u003e窗口位置\u003c/th\u003e\u003cth\u003e最小值\u003c/th\u003e\u003cth\u003e最大值\u003c/th\u003e\u003c/tr\u003e\u003ctr class\u003e\u003ctd\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e[1\u0026nbsp;\u0026nbsp;3\u0026nbsp;\u0026nbsp;-1]\u0026nbsp;-3\u0026nbsp;\u0026nbsp;5\u0026nbsp;\u0026nbsp;3\u0026nbsp;\u0026nbsp;6\u0026nbsp;\u0026nbsp;7\u0026nbsp;\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e-1\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e3\u003c/font\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr class\u003e\u003ctd\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e\u0026nbsp;1\u0026nbsp;[3\u0026nbsp;\u0026nbsp;-1\u0026nbsp;\u0026nbsp;-3]\u0026nbsp;5\u0026nbsp;\u0026nbsp;3\u0026nbsp;\u0026nbsp;6\u0026nbsp;\u0026nbsp;7\u0026nbsp;\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e-3\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e3\u003c/font\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr class\u003e\u003ctd\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e\u0026nbsp;1\u0026nbsp;\u0026nbsp;3\u0026nbsp;[-1\u0026nbsp;\u0026nbsp;-3\u0026nbsp;\u0026nbsp;5]\u0026nbsp;3\u0026nbsp;\u0026nbsp;6\u0026nbsp;\u0026nbsp;7\u0026nbsp;\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e-3\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e5\u003c/font\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr class\u003e\u003ctd\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e\u0026nbsp;1\u0026nbsp;\u0026nbsp;3\u0026nbsp;\u0026nbsp;-1\u0026nbsp;[-3\u0026nbsp;\u0026nbsp;5\u0026nbsp;\u0026nbsp;3]\u0026nbsp;6\u0026nbsp;\u0026nbsp;7\u0026nbsp;\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e-3\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e5\u003c/font\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr class\u003e\u003ctd\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e\u0026nbsp;1\u0026nbsp;\u0026nbsp;3\u0026nbsp;\u0026nbsp;-1\u0026nbsp;\u0026nbsp;-3\u0026nbsp;[5\u0026nbsp;\u0026nbsp;3\u0026nbsp;\u0026nbsp;6]\u0026nbsp;7\u0026nbsp;\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e3\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e6\u003c/font\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr class\u003e\u003ctd\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e\u0026nbsp;1\u0026nbsp;\u0026nbsp;3\u0026nbsp;\u0026nbsp;-1\u0026nbsp;\u0026nbsp;-3\u0026nbsp;\u0026nbsp;5\u0026nbsp;[3\u0026nbsp;\u0026nbsp;6\u0026nbsp;\u0026nbsp;7]\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e3\u003c/font\u003e\u003c/td\u003e\u003ctd align\u003d\"RIGHT\"\u003e\u003cfont face\u003d\"Courier New,Courier,monospace\" size\u003d\"2\"\u003e7\u003c/font\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003cp\u003e你的任务是确定每个位置上滑动窗口中的最大值和最小值。\u003cbr\u003e\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"输入包括两行。第一行包含两个整数 \u003ci\u003en\u003c/i\u003e 和 \u003ci\u003ek\u003c/i\u003e,分别表示数组的长度和滑动窗口的大小。第二行包含 \u003ci\u003en\u003c/i\u003e 个整数,表示数组的元素。\u003cbr\u003e"}},{"title":"输出","value":{"format":"HTML","content":"输出包括两行。第一行从左到右依次给出每个位置上窗口中的最小值。第二行给出每个位置上窗口中的最大值。\u003cbr\u003e"}},{"title":"示例","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e8 3\r\n1 3 -1 -3 5 3 6 7\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-1 -3 -3 -3 3 3\r\n3 3 5 5 6 7\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}