当前位置:网站首页>6090. Minimax games
6090. Minimax games
2022-07-02 15:40:00 【Laver (nori)】
class Solution {
public:
int minMaxGame(vector<int>& nums) {
int i = 0;
int len = nums.size();
while(len != 1){
// i Accessible location
int availableLen = len >> 1;
while(i < availableLen){
int ind = (i << 1);
if(1 == (i & 0x01)){
// Odd number
nums[i] = max(nums[ind], nums[ind + 1]);
}else{
// even numbers
nums[i] = min(nums[ind], nums[ind + 1]);
}
i++;
}
// Start the next visit
i = 0;
// Half and half
len >>= 1;
}
return nums[0];
}
};边栏推荐
- Facing the challenge of "lack of core", how can Feiling provide a stable and strong guarantee for customers' production capacity?
- Leetcode skimming -- incremental ternary subsequence 334 medium
- There are 7 seats with great variety, Wuling Jiachen has outstanding product power, large humanized space, and the key price is really fragrant
- 10_Redis_geospatial_命令
- [leetcode] 695 - maximum area of the island
- [leetcode] 19 delete the penultimate node of the linked list
- 17_ Redis_ Redis publish subscription
- Real estate market trend outlook in 2022
- 2022 年辽宁省大学生数学建模A、B、C题(相关论文及模型程序代码网盘下载)
- 6096. 咒语和药水的成功对数
猜你喜欢

自定义异常

搭载TI AM62x处理器,飞凌FET6254-C核心板首发上市!
![[leetcode] 417 - Pacific Atlantic current problem](/img/30/c541bc1e81eb4e348ca11116a05e84.png)
[leetcode] 417 - Pacific Atlantic current problem

17_ Redis_ Redis publish subscription

搭建自己的语义分割平台deeplabV3+

损失函数与正负样本分配:YOLO系列

彻底弄懂浏览器强缓存和协商缓存

2022 年辽宁省大学生数学建模A、B、C题(相关论文及模型程序代码网盘下载)

Leetcode skimming -- incremental ternary subsequence 334 medium

飞凌嵌入式RZ/G2L处理器核心板及开发板上手评测
随机推荐
飞凌嵌入式RZ/G2L处理器核心板及开发板上手评测
Leetcode skimming - remove duplicate letters 316 medium
已知兩種遍曆序列構造二叉樹
【LeetCode】1140-石子游戏II
[leetcode] 19 delete the penultimate node of the linked list
Leetcode skimming -- sum of two integers 371 medium
Let your HMI have more advantages. Fet-g2ld-c core board is a good choice
Facing the challenge of "lack of core", how can Feiling provide a stable and strong guarantee for customers' production capacity?
I made an istio workshop. This is the first introduction
. Net again! Happy 20th birthday
6091. 划分数组使最大差为 K
yolo格式数据集处理(xml转txt)
How to choose a third-party software testing organization for automated acceptance testing of mobile applications
【网络安全】网络资产收集
LeetCode刷题——两整数之和#371#Medium
Leetcode skimming -- incremental ternary subsequence 334 medium
For the problem that Folium map cannot be displayed, the temporary solution is as follows
Basic knowledge of cryptography
FPGA - clock-03-clock management module (CMT) of internal structure of 7 Series FPGA
Force deduction solution summarizes the lucky numbers in 1380 matrix