当前位置:网站首页>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] 417 - Pacific Atlantic current problem
- College entrance examination admission score line crawler
- 20_ Redis_ Sentinel mode
- Download blender on Alibaba cloud image station
- Basic knowledge of cryptography
- 百变大7座,五菱佳辰产品力出众,人性化大空间,关键价格真香
- Name of institution approved in advance
- Evaluation of embedded rz/g2l processor core board and development board of Feiling
猜你喜欢

Pytoch saves tensor to Mat file

14_ Redis_ Optimistic lock

党史纪实主题公益数字文创产品正式上线

FPGA - 7系列 FPGA内部结构之Clocking -03- 时钟管理模块(CMT)

Leetcode skimming -- incremental ternary subsequence 334 medium

Steps for Navicat to create a new database

Redux - detailed explanation

【LeetCode】417-太平洋大西洋水流问题

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

LeetCode刷题——验证二叉树的前序序列化#331#Medium
随机推荐
语义分割学习笔记(一)
How to choose a third-party software testing organization for automated acceptance testing of mobile applications
[leetcode] 417 - Pacific Atlantic current problem
Leetcode question brushing - parity linked list 328 medium
4. Data splitting of Flink real-time project
Folium, diagnosis and close contact trajectory above
[leetcode] 19 delete the penultimate node of the linked list
. Solution to the problem of Chinese garbled code when net core reads files
02. After containerization, you must face golang
[leetcode] 1020 number of enclaves
工程师评测 | RK3568开发板上手测试
【LeetCode】577-反转字符串中的单词 III
Be a good gatekeeper on the road of anti epidemic -- infrared thermal imaging temperature detection system based on rk3568
【LeetCode】977-有序数组的平方
高考录取分数线爬虫
基于RZ/G2L | OK-G2LD-C开发板存储读写速度与网络实测
Force deduction solution summary 2029 stone game IX
Redux - detailed explanation
11_ Redis_ Hyperloglog_ command
提前批院校名称