当前位置:网站首页>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
边栏推荐
- Integration testing of software testing
- 什么是 DevOps?看这一篇就够了!
- Common operations of oracle under linux and daily accumulation of knowledge points (functions, timed tasks)
- 提问题进不去。想问大家一个关于返回值的问题(图的遍历),求给小白解答啊
- Scaling-law和模型结构的关系:不是所有的结构放大后都能保持最好性能
- Go学习笔记(篇二)初识Go
- The fuse: OAuth 2.0 four authorized login methods must read
- 停电。。。烦烦烦!!!
- SQL外连接之交集、并集、差集查询
- PCB布局必知必会:教你正确地布设运算放大器的电路板
猜你喜欢
随机推荐
L2-042 老板的作息表
Chapter 4: In the activiti process, variable transmission and acquisition process variables, setting and acquiring multiple process variables, setting and acquiring local process variables "recommende
PPOCR 检测器配置文件参数详解
How OpenHarmony Query Device Type
今天告诉你界面控件DevExpress WinForms为何弃用经典视觉样式
发现C语言的乐趣
UDP通信
DocuWare平台——文档管理的内容服务和工作流自动化的平台详细介绍(下)
SQL外连接之交集、并集、差集查询
大佬们 我是新手,我根据文档用flinksql 写个简单的用户访问量的count 但是执行一次就结束
Ali's new launch: Microservices Assault Manual, all operations are written out in PDF
Scaling-law和模型结构的关系:不是所有的结构放大后都能保持最好性能
Leetcode刷题——623. 在二叉树中增加一行
flutter 服务器返回数据判断是否为空
RT - Thread record (a, RT, RT Thread version - Thread Studio development environment and cooperate CubeMX quick-and-dirty)
软件测试之集成测试
机器学习——集成学习
Guys, I am a novice. I use flinksql to write a simple count of user visits according to the document, but it ends after executing it once.
Import Excel/CSV from Sub Grid within Dynamics 365
化繁为简!阿里新产亿级流量系统设计核心原理高级笔记(终极版)









