当前位置:网站首页>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
边栏推荐
- 工程设备在线监测管理系统自动预警功能
- DocuWare平台——文档管理的内容服务和工作流自动化的平台详细介绍(下)
- Go学习笔记(篇二)初识Go
- Image segmentation model - a combination of segmentation_models_pytorch and albumations to achieve multi-category segmentation
- SkiaSharp 之 WPF 自绘 投篮小游戏(案例版)
- Http-Sumggling缓存漏洞分析
- FPGA: Basic Getting Started Button Controlling LED Lights
- Ali's new launch: Microservices Assault Manual, all operations are written out in PDF
- 双因子与多因子身份验证有什么区别?
- Linux: Remember to install MySQL8 on CentOS7 (blog collection)
猜你喜欢

60行从零开始自己动手写FutureTask是什么体验?

朴素贝叶斯

SQL Outer Join Intersection, Union, Difference Query

上位机开发C#语言:模拟STC串口助手接收单片机发送数据

登录功能和退出功能(瑞吉外卖)

CenOS MySQL入门及安装

电气工程的标准是什么

字节一面:TCP 和 UDP 可以使用同一个端口吗?

The host computer develops C# language: simulates the STC serial port assistant to receive the data sent by the microcontroller

MySQL 中 auto_increment 自动插入主键值
随机推荐
Linux: Remember to install MySQL8 on CentOS7 (blog collection)
abc262-D(dp)
如何选币与确定对应策略研究
Android 开发用 Kotlin 编程语言一 基本数据类型
记2022年七夕感慨
The host computer develops C# language: simulates the STC serial port assistant to receive the data sent by the microcontroller
Chapter 5: Activiti process shunting judgment, judging to go to different task nodes
图像分割模型——segmentation_models_pytorch和albumentations 组合实现多类别分割
[Translation] Chaos Net + SkyWalking: Better observability for chaos engineering
登录功能和退出功能(瑞吉外卖)
The query that the user's test score is greater than the average score of a single subject
秘乐短视频挖矿系统开发详情
Custom filters and interceptors implement ThreadLocal thread closure
支持向量机SVM
今天告诉你界面控件DevExpress WinForms为何弃用经典视觉样式
lvgl 实现状态提示图标自动对齐补位显示
Chapter 5: Multithreaded Communication—wait and notify
Image segmentation model - a combination of segmentation_models_pytorch and albumations to achieve multi-category segmentation
用KUSTO查询语句(KQL)在Azure Data Explorer Database上查询LOG实战
hdu4545 Magic String