当前位置:网站首页>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;
}
边栏推荐
- TIPC Cluster5
- 华为应用市场应用统计数据问题大揭秘
- Learn open62541 -- [66] UA_ Generation method of string
- PCL point cloud to depth image
- V2X-Sim数据集(上海交大&纽约大学)
- TIPC protocol
- 【AGC】如何解决事件分析数据本地和AGC面板中显示不一致的问题?
- 如何用list组件实现tabbar标题栏
- TIPC Service and Topology Tracking4
- [play with FPGA learning 4 in simple terms ----- talk about state machine design]
猜你喜欢

Internship report skywalking distributed link tracking?

二.Stm32f407芯片GPIO编程,寄存器操作,库函数操作和位段操作

flink二开,实现了个 batch lookup join(附源码)

三.芯片启动和时钟系统

JSP webshell free -- the basis of JSP

Hdu1236 ranking (structure Sorting)

Special topic of binary tree -- acwing 18 Rebuild the binary tree (construct the binary tree by traversing the front and middle order)

Openmldb meetup No.4 meeting minutes
![[AGC] build service 3 - authentication service example](/img/89/63f367270e806e89c4ff92360dc3c5.png)
[AGC] build service 3 - authentication service example

二叉树专题--AcWing 3384. 二叉树遍历(已知先序遍历 边建树 边输出中序遍历)
随机推荐
Matlab processing of distance measurement of experimental electron microscope
How to use ide to automatically sign and debug Hongmeng application
QT learning diary 7 - qmainwindow
[quick application] there are many words in the text component. How to solve the problem that the div style next to it will be stretched
LVM操作
Hdu1234 door opener and door closer (water question)
From Read and save in bag file Jpg pictures and PCD point cloud
二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
【深入浅出玩转FPGA学习3-----基本语法】
js中给数组添加元素的方法有哪些
[AI application] Hikvision ivms-4200 software installation
Appgallery connect scenario development practice - image storage and sharing
Is the account above changtou school safe?
二叉树专题--AcWing 3540. 二叉搜索树建树(实用板子 构建二叉搜索树 并输出前、中、后序遍历)
Thanos Receiver
AppGallery Connect场景化开发实战—图片存储分享
Filtering of PCL
2022-06-17
flink二開,實現了個 batch lookup join(附源碼)
二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)