当前位置:网站首页>St table template
St table template
2022-04-23 06:21:00 【Bzdhxs_ nt】
Template


int f[MAXN][21];
void ST(){
// No initialization
forr(i,1,n) f[i][0] = b[i];
forr(i,1,20)for(int j = 1;j+(1<<i)-1 <= n;j++){
f[j][i] = max(f[j][i-1],f[j+(1<<(i-1))][i-1]);
}
}
int query(int l,int r){
int s = __lg(r-l+1);
return max(f[l][s],f[r-(1<<s)+1][s]);
}

版权声明
本文为[Bzdhxs_ nt]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210617219289.html
边栏推荐
- 深度学习基础——简单了解meta learning(来自李宏毅课程笔记)
- Pyemd installation and simple use
- Why does the subscript of the array start from 0 instead of 1?
- How to grow at work
- Kibana search syntax
- The user name and password of users in the domain accessing the samba server outside the domain are wrong
- 2. Devops sonar installation
- Pytorch learning record (V): back propagation + gradient based optimizer (SGD, adagrad, rmsporp, Adam)
- Collections multiple parameter sorting
- 自动控制(韩敏版)
猜你喜欢

Pytorch notes - complete code for linear regression & manual or automatic calculation of gradient code comparison

20 excellent plug-ins recommended by idea

Fundamentals of in-depth learning -- a simple understanding of meta learning (from Li Hongyi's course notes)

Automatic control (Han min version)

Why does the subscript of the array start from 0 instead of 1?

List segmentation best practices

In depth source code analysis servlet first program

Pytorch notes - observe dataloader & build lenet with torch to process cifar-10 complete code

检测技术与原理

Linear algebra Chapter 1 - determinant
随机推荐
Algèbre linéaire chapitre 1 - déterminants
Paper on LDCT image reconstruction: edge enhancement based transformer for medical image denoising
线性代数第三章-矩阵的初等变换与线性方程组
常用编程记录——parser = argparse.ArgumentParser()
Calculation (enter the calculation formula to get the result)
Custom exception class
无监督去噪——[TMI2022]ISCL: Interdependent Self-Cooperative Learning for Unpaired Image Denoising
Remedy after postfix becomes a spam transit station
Rsync for file server backup
String notes
Pyqt5 learning (I): Layout Management + signal and slot association + menu bar and toolbar + packaging resource package
Pytorch notes - observe dataloader & build lenet with torch to process cifar-10 complete code
Filebrowser realizes private network disk
On traversal of binary tree
Three ways to create threads
8. Integer Decomposition
20 excellent plug-ins recommended by idea
2. Devops sonar installation
Programming record - picture rotation function SciPy ndimage. Simple use and effect observation of rotate()
自动控制(韩敏版)