当前位置:网站首页>Supermarket (heap overload
Supermarket (heap overload
2022-07-02 11:11:00 【lcxdz】
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+9;
int arr[N];
int n,m,q;
struct node {
int price,id,ed;
bool operator< (const node &ch)const{
if(ch.price!=price)return ch.price<price;
return ch.id<id;
}
};
priority_queue<node> h;
vector<node> v[N];
int main(){
cin>>n>>m>>q;
for(int i=1;i<=n;i++){
scanf("%d",&arr[i]);
h.push({
arr[i],i,m});
}
while(q--){
int x,y,l,r;
scanf("%d%d%d%d",&x,&y,&l,&r);
if(y<10)y*=10;
int p=arr[x]*y/100;
v[l].push_back({
p,x,r});
}
for(int i=1;i<=m;i++){
for(int j=0;j<v[i].size();j++)h.push(v[i][j]);
while(h.size()&&h.top().ed<i)h.pop();
cout<<h.top().id<<" ";
}
return 0;
}
边栏推荐
- Creation and use of unified links in Huawei applinking
- 【AI应用】海康威视iVMS-4200软件安装
- Jenkins安装
- LabVIEW为什么浮点数会丢失精度
- STM32单片机编程学习
- 一招快速实现自定义快应用titlebar
- flink二开,实现了个 batch lookup join(附源码)
- K-d tree and octree of PCL
- From Read and save in bag file Jpg pictures and PCD point cloud
- The most detailed MySQL installation tutorial
猜你喜欢

JSP webshell免殺——JSP的基礎

Why does LabVIEW lose precision in floating point numbers

【深入浅出玩转FPGA学习2----设计技巧(基本语法)】

How does the whole network display IP ownership?

The first white paper on agile practice in Chinese enterprises was released | complete download is attached

实验电镜距离测量之Matlab处理

【深入浅出玩转FPGA学习5-----复位设计】
![[applinking practical case] share in app pictures through applinking](/img/12/5616f1fa55387b81e25e55a98022b9.png)
[applinking practical case] share in app pictures through applinking

二叉树专题--AcWing 19. 二叉树的下一个节点(找树中节点的后继)

Thanos Receiver
随机推荐
Luogu p1892 [boi2003] Gang (and search for variant anti set)
Static variables in static function
Special topic of binary tree -- acwing 18 Rebuild the binary tree (construct the binary tree by traversing the front and middle order)
Special topic of binary tree -- acwing 3540 Binary search tree building (use the board to build a binary search tree and output the pre -, middle -, and post sequence traversal)
TIPC messaging3
STM32单片机编程学习
Thanos Receiver
【深入浅出玩转FPGA学习2----设计技巧(基本语法)】
洛谷 P4281 [AHOI2008]紧急集合 / 聚会(树上倍增 LCA)
[ark UI] implementation of the startup page of harmonios ETS
二叉树专题--AcWing 1589. 构建二叉搜索树
金山云——2023届暑期实习
Logu p3398 hamster looks for sugar (double LCA on the tree to judge whether the two paths in the tree intersect)
Approximate sum count (approximate
全网显示 IP 归属地,是怎么实现的?
三.芯片启动和时钟系统
String (Analog
【深入浅出玩转FPGA学习5-----复位设计】
Overview of integrated learning
【快应用】text组件里的文字很多,旁边的div样式会被拉伸如何解决