当前位置:网站首页>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];
}
};边栏推荐
- 6096. 咒语和药水的成功对数
- 14_ Redis_ Optimistic lock
- Summary of the first three passes of sqli Labs
- FPGA - clock-03-clock management module (CMT) of internal structure of 7 Series FPGA
- Yolov5 code reproduction and server operation
- Let your HMI have more advantages. Fet-g2ld-c core board is a good choice
- 夏季高考文化成绩一分一段表
- How to intercept the value of a key from the JSON string returned by wechat?
- LeetCode刷题——验证二叉树的前序序列化#331#Medium
- [leetcode] 977 square of ordered array
猜你喜欢

. Solution to the problem of Chinese garbled code when net core reads files

SQL stored procedure

17_ Redis_ Redis publish subscription

MySQL calculate n-day retention rate

SQL transaction

【LeetCode】1162-地图分析

Leetcode question brushing - parity linked list 328 medium

PTA 天梯赛习题集 L2-001 城市间紧急救援

18_ Redis_ Redis master-slave replication & cluster building

FPGA - 7系列 FPGA内部结构之Clocking -03- 时钟管理模块(CMT)
随机推荐
4. Data splitting of Flink real-time project
LeetCode刷题——去除重复字母#316#Medium
Download blender on Alibaba cloud image station
Bing. Com website
04.进入云原生后的企业级应用构建的一些思考
Solve the problem of frequent interruption of mobaxterm remote connection
5. Practice: jctree implements the annotation processor at compile time
PTA ladder game exercise set l2-001 inter city emergency rescue
搭建自己的语义分割平台deeplabV3+
I made an istio workshop. This is the first introduction
13_ Redis_ affair
Bing. Site Internet
College entrance examination admission score line crawler
【LeetCode】877-石子游戏
2303. 计算应缴税款总额
语义分割学习笔记(一)
LeetCode_ String_ Simple_ 412.Fizz Buzz
Let your HMI have more advantages. Fet-g2ld-c core board is a good choice
Redux - detailed explanation
【LeetCode】1905-统计子岛屿