当前位置:网站首页>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];
}
};边栏推荐
- 04. Some thoughts on enterprise application construction after entering cloud native
- Solve the problem of frequent interruption of mobaxterm remote connection
- Oracle primary key auto increment
- Thoroughly understand browser strong cache and negotiation cache
- Custom exception
- 6090. 极大极小游戏
- Beijing rental data analysis
- [leetcode] 486 predict winners
- 【LeetCode】977-有序数组的平方
- 13_ Redis_ affair
猜你喜欢

Equipped with Ti am62x processor, Feiling fet6254-c core board is launched!

Bing. Com website

百变大7座,五菱佳辰产品力出众,人性化大空间,关键价格真香

10_ Redis_ geospatial_ command

Leetcode question brushing - parity linked list 328 medium

LeetCode刷题——统计各位数字都不同的数字个数#357#Medium

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

已知两种遍历序列构造二叉树

Redux——详解

Finally, I understand the event loop, synchronous / asynchronous, micro task / macro task, and operation mechanism in JS (with test questions attached)
随机推荐
Yolov5 code reproduction and server operation
4. Jctree related knowledge learning
Force deduction solution summarizes the lucky numbers in 1380 matrix
Pytoch saves tensor to Mat file
彻底弄懂浏览器强缓存和协商缓存
【LeetCode】19-删除链表的倒数第N个结点
密码学基础知识
List of sergeant schools
Name of institution approved in advance
12_ Redis_ Bitmap_ command
Finally, I understand the event loop, synchronous / asynchronous, micro task / macro task, and operation mechanism in JS (with test questions attached)
6096. 咒语和药水的成功对数
Loss function and positive and negative sample allocation: Yolo series
[leetcode] 977 square of ordered array
College entrance examination score line climbing
【LeetCode】200-岛屿数量
Pytorch 保存tensor到.mat文件
【LeetCode】876-链表的中间结点
【LeetCode】977-有序數組的平方
MySQL -- Index Optimization -- order by