当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
【AppLinking实战案例】通过AppLinking分享应用内图片
Flink two Open, implement Batch Lookup join (attached source)
How to use ide to automatically sign and debug Hongmeng application
全网显示 IP 归属地,是怎么实现的?
QT学习日记7——QMainWindow
2022爱分析· 国央企数字化厂商全景报告
Special topic of binary tree -- acwing 1497 Traversal of the tree (use post and mid order traversal to build a binary tree)
二叉树专题--洛谷 P1229 遍历问题(乘法原理 已知前、后序遍历求中序遍历个数)
From Read and save in bag file Jpg pictures and PCD point cloud
Creation and use of unified links in Huawei applinking
随机推荐
Iii. Système de démarrage et d'horloge à puce
QT learning diary 8 - resource file addition
Primary key policy problem
[AI application] Hikvision ivms-4200 software installation
[play with FPGA learning 5 in simple terms ----- reset design]
华为应用市场应用统计数据问题大揭秘
TIPC 寻址2
Overview of integrated learning
实验电镜距离测量之Matlab处理
Common methods of JS array
Special topic of binary tree -- acwing 3384 Binary tree traversal (known preorder traversal, while building a tree, while outputting middle order traversal)
III Chip startup and clock system
一.STM32的开发环境,keil5/MDK5.14安装教程(附下载链接)
洛谷 P5536 【XR-3】核心城市(贪心 + 树形 dp 寻找树的中心)
LabVIEW为什么浮点数会丢失精度
The first white paper on agile practice in Chinese enterprises was released | complete download is attached
【AGC】如何解决事件分析数据本地和AGC面板中显示不一致的问题?
一招快速实现自定义快应用titlebar
String (Analog
PCL extracts a subset from a point cloud