当前位置:网站首页>ST表模板
ST表模板
2022-04-21 06:21:00 【Bzdhxs_nt】
Template


int f[MAXN][21];
void ST(){
// 不用初始化
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://blog.csdn.net/qq_51687628/article/details/124104749
边栏推荐
- 3. 事务和视图
- 手势识别调研
- Reproduce the 3D density function diagram in the top issue of SCI
- Implémenter un tableau en tant que fonction JS. Prototype. Foreach (),. Map (),. Filtre ()
- [SSM integration] 4 Logic code writing and testing
- [STM32] cubemx configuration diagram of 480mhz clock under 25MHz external crystal oscillator of h743
- 【W5500】STM32 H743驱动W5500进行UDP收发
- 做一款自己的小程序
- SQL--数据定义
- 【STM32 H7】H743各个内存块地址分布备忘
猜你喜欢

applicationContext. How to solve the problem of XML becoming gray document

MySQL Workbench cannot use clear text authentication over non-ssl connections 问题解决

Tensorflow example 3: recognition training of verification code pictures. Each picture has 4 letters

【SSM整合】1. 基本环境搭建

【ThreadX】ThreadX源码阅读计划(二)

Official account version update and introduction

SQL--数据的过滤和分组

2020杭电多校赛第四场1007 Go Running(hdu6808)

【STM32 H7】H743各个内存块地址分布备忘

Format checking tool eslint
随机推荐
This site cannot provide a secure connection. An unsupported protocol is used
【SSM整合】1. 基本环境搭建
How to package idea into war package
【STM32&LWIP】记录一次诡异的ping不通的解决方法
[LabVIEW] record some pits in LabVIEW project
改图片后缀
If I use Monet's color matching in scientific research pictures?
力扣-322.零钱兑换
【ThreadX】H743+ThreadX+FileX移植记录
[ThreadX] ThreadX source code reading plan (II)
[STM32 H7] h743 notes on address distribution of each memory block
Sublime Text3 installation simplified Chinese
Linux启动MySQL报错
Pm2 部署 Nuxt 项目
MySQL Workbench cannot use clear text authentication over non-ssl connections 问题解决
BatchUpdateException在MySQL和Oracle的区别
JS 对象与字符串相互转换
Simultaneous access of computer intranet and extranet - solution
Summary of differences between MySQL and Oracle
Sublime Text3 安装简体中文