HBC51001小圆前辈的暴力枚举,动态规划,数位dpSliding Window题解 (anarrayofsize)

水水月牙 STL编程 60 0
全网最全C++题库,助您快速提升编程技能!题库丰富多样,涵盖各个领域,让您在练习中不断成长!
An array of sizen≤ 106is given to you. There is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbers in the window. Each time the sliding window moves rightwards by one position. Following is an example: The array is[13-1-35367], andkis 3. Window position Minimum value Maximum value [13-1]-35367 -1 3 1[3-1-3]5367 -3 3 13[-1-35]367 -3 5 13-1[-353]67 -3 5 13-1-3[536]7 3 6 13-1-35[367] 3 7 Your task is to determine the maximum and minimum values in the sliding window at each position.

An array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves rightwards by one position. Following is an example:  The array is [1 3 -1 -3 5 3 6 7], and k is 3. Window position Minimum value Maximum value [1  3  -1] -3  5  3  6  7  -1 3  1 [3  -1  -3] 5  3  6  7  -3 3  1  3 [-1  -3  5] 3  6  7  -3 5  1  3  -1 [-3  5  3] 6  7  -3 5  1  3  -1  -3 [5  3  6] 7  3 6  1  3  -1  -3  5 [3  6  7] 3 7 Your task is to determine the maximum and minimum values in the sliding window at each position. 

HBC51001小圆前辈的暴力枚举,动态规划,数位dpSliding Window题解
(anarrayofsize)-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
想要在职场中立于不败之地?那就来试试全网最全C++题库,让您在练习中快速提升技能。

标签: HBC51001小圆前辈的暴力枚举 动态规划 数位dpSliding Window题解