当前位置:网站首页>nyoj1185最大最小值(线段树)
nyoj1185最大最小值(线段树)
2022-08-05 11:02:00 【51CTO】
这道题普通方法 ,TLE。
最大最小值
1000 ms | 内存限制: 65535
2
给出N个整数,执行M次询问。
对于每次询问,首先输入三个整数C、L、R:
如果C等于1,输出第L个数到第R个数之间的最小值;
如果C等于2,输出第L个数到第R个数之间的最大值;
如果C等于3,输出第L个数到第R个数之间的最小值与最大值的和。
(包括第L个数和第R个数)。
首先输入一个整数T(T≤100),表示有T组数据。
对于每组数据,先输入一个整数N(1≤N≤10000),表示有N个整数;
接下来一行有N个整数a(1≤a≤10000);
然后输入一个整数M,表示有M次询问;
接下来有M行(1≤M≤10000),每行有3个整数C、L、R(1≤C≤3,1≤L≤R≤N)。
输出 按照题意描述输出。每个输出占一行。 样例输入
2 4 1 3 2 4 2 1 1 4 2 2 3 5 1 2 3 4 5 1 3 1 5
样例输出
1 3 6
边栏推荐
- 拓朴排序例题
- The host computer develops C# language: simulates the STC serial port assistant to receive the data sent by the microcontroller
- Android development with Kotlin programming language II Conditional control
- 例题 可达性统计+bitset的使用
- 张朝阳对话俞敏洪:一边是手推物理公式,一边是古诗信手拈来
- abc262-D(dp)
- .NET in-depth analysis of the LINQ framework (6: LINQ execution expressions)
- 脱光衣服待着就能减肥,当真有这好事?
- Android 开发用 Kotlin 编程语言三 循环控制
- PostgreSQL 2022 报告:流行度上涨,开源、可靠性和扩展是关键
猜你喜欢
5G NR 系统消息
PostgreSQL 2022 报告:流行度上涨,开源、可靠性和扩展是关键
脱光衣服待着就能减肥,当真有这好事?
支持向量机SVM
How to choose coins and determine the corresponding strategy research
RT - Thread record (a, RT, RT Thread version - Thread Studio development environment and cooperate CubeMX quick-and-dirty)
四、kubeadm单master
朴素贝叶斯
SQL外连接之交集、并集、差集查询
Opencv图像缩放和平移
随机推荐
What do T and Z in the time format 2020-01-13T16:00:00.000Z represent and how to deal with them
Common operations of oracle under linux and daily accumulation of knowledge points (functions, timed tasks)
提取人脸特征的三种方法
[Translation] Chaos Net + SkyWalking: Better observability for chaos engineering
Ali's new launch: Microservices Assault Manual, all operations are written out in PDF
双因子与多因子身份验证有什么区别?
自定义过滤器和拦截器实现ThreadLocal线程封闭
Mathcad 15.0软件安装包下载及安装教程
Android development with Kotlin programming language II Conditional control
[Android] How to use RecycleView in Kotlin project
智能算力的枢纽如何构建?中国云都的淮海智算中心打了个样
【OpenCV】-仿射变换
012_SSS_ Improving Diffusion Model Efficiency Through Patching
poj2935 Basic Wall Maze (2016xynu暑期集训检测 -----D题)
今天告诉你界面控件DevExpress WinForms为何弃用经典视觉样式
Android 开发用 Kotlin 编程语言三 循环控制
【AGC】增长服务1-远程配置示例
.NET深入解析LINQ框架(六:LINQ执行表达式)
朴素贝叶斯
MMDetection in action: MMDetection training and testing