当前位置:网站首页>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];
}
};边栏推荐
- [leetcode] 877 stone game
- 百变大7座,五菱佳辰产品力出众,人性化大空间,关键价格真香
- LeetCode刷题——递增的三元子序列#334#Medium
- 2278. 字母在字符串中的百分比
- Basic knowledge of cryptography
- 17_ Redis_ Redis publish subscription
- Leetcode skimming -- verifying the preorder serialization of binary tree # 331 # medium
- LeetCode刷题——两整数之和#371#Medium
- 飞凌嵌入式RZ/G2L处理器核心板及开发板上手评测
- 15_ Redis_ Redis. Conf detailed explanation
猜你喜欢

MySQL -- Index Optimization -- order by

终于搞懂了JS中的事件循环,同步/异步,微任务/宏任务,运行机制(附笔试题)

Yolov5 code reproduction and server operation

How to intercept the value of a key from the JSON string returned by wechat?

14_ Redis_ Optimistic lock

10_Redis_geospatial_命令
![[leetcode] 1162 map analysis](/img/9a/d04bde0417d4d5232950a4e260eb91.png)
[leetcode] 1162 map analysis

Bing.com網站

Solve the problem of frequent interruption of mobaxterm remote connection

PTA 天梯赛习题集 L2-001 城市间紧急救援
随机推荐
Steps for Navicat to create a new database
[leetcode] 1254 - count the number of closed Islands
6095. 强密码检验器 II
【LeetCode】200-岛屿数量
密码学基础知识
[leetcode] 877 stone game
List of sergeant schools
SQL stored procedure
FPGA - 7系列 FPGA内部结构之Clocking -03- 时钟管理模块(CMT)
MySQL -- Index Optimization -- order by
(Video + graphic) machine learning introduction series - Chapter 5 machine learning practice
LeetCode刷题——去除重复字母#316#Medium
高考分数线爬取
[leetcode] 200 number of islands
【LeetCode】977-有序數組的平方
College entrance examination admission score line crawler
Folium, diagnosis and close contact trajectory above
【LeetCode】1162-地图分析
Bing. Com website
YOLOV5 代码复现以及搭载服务器运行